www.pudn.com > new xsc.rar > frmzongping.frm


VERSION 5.00 
Begin VB.Form frmzongping  
   Caption         =   "班级总评" 
   ClientHeight    =   6255 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   6045 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MDIChild        =   -1  'True 
   ScaleHeight     =   6255 
   ScaleWidth      =   6045 
   Begin VB.Frame Frame1  
      Caption         =   "基本信息" 
      Height          =   2055 
      Index           =   0 
      Left            =   120 
      TabIndex        =   18 
      Top             =   120 
      Width           =   5775 
      Begin VB.ComboBox Combo4  
         Height          =   300 
         Index           =   1 
         ItemData        =   "frmzongping.frx":0000 
         Left            =   2655 
         List            =   "frmzongping.frx":0028 
         TabIndex        =   24 
         Top             =   1560 
         Width           =   1095 
      End 
      Begin VB.ComboBox Combo3  
         Height          =   300 
         Index           =   1 
         ItemData        =   "frmzongping.frx":0053 
         Left            =   960 
         List            =   "frmzongping.frx":0063 
         TabIndex        =   23 
         Top             =   1560 
         Width           =   1095 
      End 
      Begin VB.ComboBox Combo4  
         Height          =   300 
         Index           =   0 
         ItemData        =   "frmzongping.frx":007F 
         Left            =   2655 
         List            =   "frmzongping.frx":00A7 
         TabIndex        =   22 
         Top             =   1020 
         Width           =   1095 
      End 
      Begin VB.ComboBox Combo3  
         Height          =   300 
         Index           =   0 
         ItemData        =   "frmzongping.frx":00D2 
         Left            =   960 
         List            =   "frmzongping.frx":00E2 
         TabIndex        =   21 
         Top             =   1020 
         Width           =   1095 
      End 
      Begin VB.TextBox Text1  
         Enabled         =   0   'False 
         Height          =   375 
         Left            =   3720 
         TabIndex        =   20 
         Top             =   240 
         Width           =   1815 
      End 
      Begin VB.ComboBox Combo1  
         Height          =   300 
         Left            =   960 
         TabIndex        =   19 
         Text            =   "选择" 
         Top             =   300 
         Width           =   1215 
      End 
      Begin VB.Label Label11  
         AutoSize        =   -1  'True 
         Caption         =   "学期结束" 
         Height          =   180 
         Left            =   4560 
         TabIndex        =   33 
         Top             =   1620 
         Width           =   720 
      End 
      Begin VB.Label Label10  
         AutoSize        =   -1  'True 
         Caption         =   "学期开始" 
         Height          =   180 
         Left            =   4560 
         TabIndex        =   32 
         Top             =   1080 
         Width           =   720 
      End 
      Begin VB.Label Label9  
         AutoSize        =   -1  'True 
         Caption         =   "月" 
         Height          =   180 
         Index           =   1 
         Left            =   3960 
         TabIndex        =   31 
         Top             =   1620 
         Width           =   180 
      End 
      Begin VB.Label Label8  
         AutoSize        =   -1  'True 
         Caption         =   "年" 
         Height          =   180 
         Index           =   1 
         Left            =   2265 
         TabIndex        =   30 
         Top             =   1620 
         Width           =   180 
      End 
      Begin VB.Label Label9  
         AutoSize        =   -1  'True 
         Caption         =   "月" 
         Height          =   180 
         Index           =   0 
         Left            =   3960 
         TabIndex        =   29 
         Top             =   1080 
         Width           =   180 
      End 
      Begin VB.Label Label8  
         AutoSize        =   -1  'True 
         Caption         =   "年" 
         Height          =   180 
         Index           =   0 
         Left            =   2265 
         TabIndex        =   28 
         Top             =   1080 
         Width           =   180 
      End 
      Begin VB.Label Label7  
         AutoSize        =   -1  'True 
         Caption         =   "学期" 
         Height          =   180 
         Left            =   360 
         TabIndex        =   27 
         Top             =   1080 
         Width           =   360 
      End 
      Begin VB.Label Label2  
         AutoSize        =   -1  'True 
         Caption         =   "班主任姓名" 
         Height          =   180 
         Left            =   2520 
         TabIndex        =   26 
         Top             =   360 
         Width           =   900 
      End 
      Begin VB.Label Label1  
         AutoSize        =   -1  'True 
         Caption         =   "班级" 
         Height          =   180 
         Left            =   360 
         TabIndex        =   25 
         Top             =   360 
         Width           =   360 
      End 
   End 
   Begin VB.Frame Frame2  
      Caption         =   "考核测评" 
      Height          =   2655 
      Left            =   120 
      TabIndex        =   3 
      Top             =   2400 
      Width           =   5775 
      Begin VB.TextBox Text2  
         Height          =   375 
         Left            =   1200 
         TabIndex        =   10 
         Top             =   2160 
         Width           =   1455 
      End 
      Begin VB.TextBox Text3  
         Height          =   375 
         Index           =   0 
         Left            =   1200 
         TabIndex        =   9 
         Top             =   480 
         Width           =   1455 
      End 
      Begin VB.TextBox Text3  
         Height          =   375 
         Index           =   1 
         Left            =   1200 
         TabIndex        =   8 
         Top             =   1040 
         Width           =   1455 
      End 
      Begin VB.TextBox Text3  
         Height          =   375 
         Index           =   2 
         Left            =   1200 
         TabIndex        =   7 
         Top             =   1600 
         Width           =   1455 
      End 
      Begin VB.TextBox Text3  
         Height          =   375 
         Index           =   4 
         Left            =   4080 
         TabIndex        =   6 
         Top             =   480 
         Width           =   1455 
      End 
      Begin VB.TextBox Text3  
         Height          =   375 
         Index           =   5 
         Left            =   4080 
         TabIndex        =   5 
         Top             =   1040 
         Width           =   1455 
      End 
      Begin VB.TextBox Text3  
         Height          =   375 
         Index           =   6 
         Left            =   4080 
         TabIndex        =   4 
         Top             =   1600 
         Width           =   1455 
      End 
      Begin VB.Label Label6  
         AutoSize        =   -1  'True 
         Caption         =   "总评" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   134 
            Weight          =   700 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   180 
         Index           =   4 
         Left            =   120 
         TabIndex        =   17 
         Top             =   2220 
         Width           =   390 
      End 
      Begin VB.Label Label6  
         AutoSize        =   -1  'True 
         Caption         =   "学生测评" 
         Height          =   180 
         Index           =   0 
         Left            =   3240 
         TabIndex        =   16 
         Top             =   480 
         Width           =   720 
      End 
      Begin VB.Label Label5  
         AutoSize        =   -1  'True 
         Caption         =   "学生会" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   15 
         Top             =   1755 
         Width           =   540 
      End 
      Begin VB.Label Label4  
         AutoSize        =   -1  'True 
         Caption         =   "任课教师" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   14 
         Top             =   1125 
         Width           =   720 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Caption         =   "教务处" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   13 
         Top             =   480 
         Width           =   540 
      End 
      Begin VB.Label Label6  
         AutoSize        =   -1  'True 
         Caption         =   "违纪扣分" 
         Height          =   180 
         Index           =   1 
         Left            =   3240 
         TabIndex        =   12 
         Top             =   1140 
         Width           =   720 
      End 
      Begin VB.Label Label6  
         AutoSize        =   -1  'True 
         Caption         =   "学生处" 
         Height          =   180 
         Index           =   2 
         Left            =   3240 
         TabIndex        =   11 
         Top             =   1740 
         Width           =   540 
      End 
   End 
   Begin VB.Frame Frame3  
      Caption         =   "操作" 
      Height          =   855 
      Left            =   120 
      TabIndex        =   0 
      Top             =   5280 
      Width           =   5775 
      Begin VB.CommandButton Command2  
         Caption         =   "取消" 
         Height          =   375 
         Left            =   3600 
         TabIndex        =   2 
         Top             =   360 
         Width           =   975 
      End 
      Begin VB.CommandButton Command1  
         Caption         =   "确定" 
         Height          =   375 
         Left            =   1080 
         TabIndex        =   1 
         Top             =   360 
         Width           =   975 
      End 
   End 
End 
Attribute VB_Name = "frmzongping" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
 
 
Private Sub Form_Load() 
  Me.Height = 6660 
  Me.Width = 6165 
Dim mrccc As ADODB.Recordset 
  Dim msgtext As String 
  Dim txtSQL As String 
   
' Combo1.Clear 
  txtSQL = "select id from class" 
  Set mrccc = ExecuteSQL(txtSQL, msgtext) 
 
   Do While Not mrccc.EOF 
    Combo1.AddItem mrccc.Fields(0) 
    mrccc.MoveNext 
   Loop 
   mrccc.Close 
End Sub 
Private Sub Command2_Click() 
  Unload Me 
End Sub 
Private Sub Combo1_Click() 
 Dim mrccc As ADODB.Recordset 
  Dim msgtext As String 
  Dim txtSQL As String 
  Dim aa As String 
  txtSQL = "select name1 from teacher  where class='" & Combo1 & "' " 
  Set mrccc = ExecuteSQL(txtSQL, msgtext) 
  If Not mrccc.EOF Then 
    Text1.Text = mrccc.Fields(0) 
  Else: MsgBox "该班级没有班主任,检查数据库设置" 
  End If 
  
End Sub 
 
Private Sub Command1_Click() 
  Dim intcount As Integer 
  Dim smg, smg1, zong As String 
  Dim mr As ADODB.Recordset 
  Dim msgtext As String 
  
  If Trim(Combo1 & "") = "选择" Then 
   MsgBox "请选择班级", vbOKOnly + vbExclamation, "警告" 
   Exit Sub 
  End If 
   If Trim(Combo3(0) & "") = "" Then 
   MsgBox "请选择年份", vbOKOnly + vbExclamation, "警告" 
   Exit Sub 
  End If 
  If Trim(Combo4(0) & "") = "" Then 
   MsgBox "请选择月份", vbOKOnly + vbExclamation, "警告" 
   Exit Sub 
  End If 
  If Trim(Combo3(1) & "") = "" Then 
   MsgBox "请选择年份", vbOKOnly + vbExclamation, "警告" 
   Exit Sub 
  End If 
  If Trim(Combo4(1) & "") = "" Then 
   MsgBox "请选择月份", vbOKOnly + vbExclamation, "警告" 
   Exit Sub 
  End If 
  smg = Format(CDate(Combo3(0) & "-" & Combo4(0) & "-" & "1"), "yyyy-mm-dd") 
  smg1 = Format(CDate(Combo3(1) & "-" & Combo4(1) & "-" & "1"), "yyyy-mm-dd") 
  If smg1 <= smg Then 
     MsgBox "错误!请检查学期的起止日期", vbOKOnly + vbExclamation, "警告" 
   Exit Sub 
  End If 
  txtSQL = "select 总评 from xueshenghui where 班级='" & Trim(Combo1) & "' and 学期1='" & smg & "' and 学期2='" & smg1 & "'" 
  Set mr = ExecuteSQL(txtSQL, msgtext) 
  If Not mr.EOF Then 
    Text3(2).Text = mr.Fields(0) 
  Else 
    MsgBox "本学期学生会对本班级测评结果未能找到,请输入有关数据或检查学期是否选择正确", vbOKOnly + vbExclamation, "警告" 
    Exit Sub 
  End If 
   txtSQL = "select 总评 from xueshengchu where 班级='" & Trim(Combo1) & "' and 学期1='" & smg & "' and 学期2='" & smg1 & "'" 
  Set mr = ExecuteSQL(txtSQL, msgtext) 
  If Not mr.EOF Then 
    Text3(6).Text = mr.Fields(0) 
  Else 
    MsgBox "本学期学生处对本班级测评结果未能找到,请输入有关数据或检查学期是否选择正确", vbOKOnly + vbExclamation, "警告" 
    Exit Sub 
  End If 
   txtSQL = "select 总评 from xuesheng where 班级='" & Trim(Combo1) & "' and 学期1='" & smg & "' and 学期2='" & smg1 & "'" 
  Set mr = ExecuteSQL(txtSQL, msgtext) 
  If Not mr.EOF Then 
    Text3(4).Text = mr.Fields(0) 
  Else 
    MsgBox "本学期学生对本班级测评结果未能找到,请输入有关数据或检查学期是否选择正确", vbOKOnly + vbExclamation, "警告" 
    Exit Sub 
  End If 
  txtSQL = "select 总评 from jiaowuchu where 班级='" & Trim(Combo1) & "' and 学期1='" & smg & "' and 学期2='" & smg1 & "'" 
  Set mr = ExecuteSQL(txtSQL, msgtext) 
  If Not mr.EOF Then 
    Text3(0).Text = mr.Fields(0) 
  Else 
    MsgBox "本学期教务处对本班级测评结果未能找到,请输入有关数据或检查学期是否选择正确", vbOKOnly + vbExclamation, "警告" 
    Exit Sub 
 End If 
  txtSQL = "select 总评 from renkejiaoshizongping where 班级='" & Trim(Combo1) & "' and 学期1='" & smg & "' and 学期2='" & smg1 & "'" 
  Set mr = ExecuteSQL(txtSQL, msgtext) 
  If Not mr.EOF Then 
    Text3(1).Text = mr.Fields(0) 
  Else 
    MsgBox "本学期人课教师对本班级总测评结果未能找到,请输入有关数据或检查学期是否选择正确", vbOKOnly + vbExclamation, "警告" 
    Exit Sub 
 End If 
  txtSQL = "select zhi from koufen where class='" & Trim(Combo1) & "' and xueqi1='" & smg & "' and xueqi2='" & smg1 & "'" 
  Set mr = ExecuteSQL(txtSQL, msgtext) 
  If Not mr.EOF Then 
    Text3(5).Text = mr.Fields(0) 
  Else 
    MsgBox "本学期本班级扣分情况未能查到,请确认输入有关数据或检查学期是否选择正确", vbOKOnly + vbExclamation, "警告" 
    Exit Sub 
 End If 
 zong = (Int(Text3(0).Text) + Int(Text3(1).Text) + Int(Text3(2).Text) + Int(Text3(5).Text) + Int(Text3(4).Text) + Int(Text3(6).Text)) / 6 
 txtSQL = "delete from ceping where 班级='" & Trim(Combo1) & "' and 学期1='" & smg & "' and 学期1='" & smg1 & "'" 
 Set mr = ExecuteSQL(txtSQL, msgtext) 
 txtSQL = "execute cepingsetup'" 
  txtSQL = txtSQL & Trim(Text3(0)) & "','" 
  txtSQL = txtSQL & Trim(Text3(1)) & "','" 
  txtSQL = txtSQL & Trim(Text3(4)) & "','" 
  txtSQL = txtSQL & Trim(Text3(5).Text) & "','" 
  txtSQL = txtSQL & Trim(Text3(2).Text) & "','" 
  txtSQL = txtSQL & Trim(Text3(6).Text) & "','" 
  txtSQL = txtSQL & zong & "','" 
  txtSQL = txtSQL & smg & "','" 
  txtSQL = txtSQL & Trim(Text1.Text) & "','" 
  txtSQL = txtSQL & Trim(Combo1) & "','" 
  txtSQL = txtSQL & smg1 & "'" 
  Set mr = ExecuteSQL(txtSQL, msgtext) 
  MsgBox "添加纪录成功!", vbOKOnly + vbExclamation, "添加纪录" 
   
End Sub