Frmxuefei2.frm
上传用户:bubble
上传日期:2007-03-02
资源大小:403k
文件大小:15k
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
- Begin VB.Form Frmxuefei2
- BorderStyle = 1 'Fixed Single
- ClientHeight = 5010
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 11595
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MDIChild = -1 'True
- MinButton = 0 'False
- ScaleHeight = 5010
- ScaleWidth = 11595
- Begin VB.OptionButton Option2
- Caption = "选择条件显示数据"
- ForeColor = &H00C00000&
- Height = 180
- Left = 5520
- TabIndex = 13
- Top = 120
- Width = 2175
- End
- Begin VB.OptionButton Option1
- Caption = "显示全部数据"
- ForeColor = &H00C00000&
- Height = 180
- Left = 3480
- TabIndex = 12
- Top = 120
- Value = -1 'True
- Width = 1695
- End
- Begin VB.Frame Frame6
- Caption = "浏览数据"
- Height = 3975
- Left = 120
- TabIndex = 10
- Top = 960
- Width = 11415
- Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSF1
- Height = 3615
- Left = 120
- TabIndex = 11
- Top = 240
- Width = 11175
- _ExtentX = 19711
- _ExtentY = 6376
- _Version = 393216
- BackColor = -2147483624
- BackColorSel = 16777215
- ForeColorSel = 255
- BackColorBkg = -2147483624
- GridColor = 12632256
- GridColorFixed = 4210752
- SelectionMode = 1
- AllowUserResizing= 3
- _NumberOfBands = 1
- _Band(0).Cols = 2
- End
- End
- Begin VB.Frame Frame5
- Caption = "学期:"
- Height = 615
- Left = 8640
- TabIndex = 8
- Top = 360
- Width = 2895
- Begin VB.ComboBox Combo1
- BackColor = &H80000018&
- Height = 300
- Index = 3
- Left = 120
- Style = 2 'Dropdown List
- TabIndex = 9
- Top = 195
- Width = 2655
- End
- End
- Begin VB.Frame Frame4
- Caption = "年制:"
- Height = 615
- Left = 7080
- TabIndex = 6
- Top = 360
- Width = 1575
- Begin VB.ComboBox Combo1
- BackColor = &H80000018&
- Height = 300
- Index = 2
- Left = 120
- Style = 2 'Dropdown List
- TabIndex = 7
- Top = 195
- Width = 1335
- End
- End
- Begin VB.Frame Frame3
- Caption = "专业:"
- Height = 615
- Left = 5400
- TabIndex = 4
- Top = 360
- Width = 1695
- Begin VB.ComboBox Combo1
- BackColor = &H80000018&
- Height = 300
- Index = 1
- Left = 120
- Style = 2 'Dropdown List
- TabIndex = 5
- Top = 195
- Width = 1455
- End
- End
- Begin VB.Frame Frame2
- Caption = "年级:"
- Height = 615
- Left = 3360
- TabIndex = 2
- Top = 360
- Width = 2055
- Begin VB.ComboBox Combo1
- BackColor = &H80000018&
- Height = 300
- Index = 0
- Left = 120
- Style = 2 'Dropdown List
- TabIndex = 3
- Top = 195
- Width = 1815
- End
- End
- Begin VB.Frame Frame1
- Height = 975
- Left = 120
- TabIndex = 0
- Top = 0
- Width = 3040
- Begin MSComctlLib.Toolbar Toolbar1
- Height = 765
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 2895
- _ExtentX = 5106
- _ExtentY = 1349
- ButtonWidth = 1032
- ButtonHeight = 1349
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 7
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "查找"
- Object.Tag = "find"
- ImageKey = "find"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "修改"
- Key = "modi"
- Object.Tag = "modi"
- ImageKey = "modi"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Object.Tag = "del"
- ImageKey = "del"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "打印"
- Object.Tag = "print"
- ImageKey = "print"
- Style = 5
- BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628}
- NumButtonMenus = 2
- BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "dang"
- Text = "打印当前记录"
- EndProperty
- BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "all"
- Text = "打印全部记录"
- EndProperty
- EndProperty
- EndProperty
- EndProperty
- End
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 7320
- Top = 240
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 32
- ImageHeight = 32
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 4
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Frmxuefei2.frx":0000
- Key = "del"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Frmxuefei2.frx":0458
- Key = "print"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Frmxuefei2.frx":0AD4
- Key = "find"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Frmxuefei2.frx":0F28
- Key = "modi"
- EndProperty
- EndProperty
- End
- End
- Attribute VB_Name = "Frmxuefei2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Public printstr As String
- Public Sub xuefeishowtitle()
- Dim i As Integer
- With MSF1
- .Cols = 6
-
- .TextMatrix(0, 1) = "年级"
- .TextMatrix(0, 2) = "专业"
- .TextMatrix(0, 3) = "年制"
- .TextMatrix(0, 4) = "学期"
- .TextMatrix(0, 5) = "学费(元)"
-
- .ColWidth(0) = 200
- .ColWidth(1) = 2000
- .ColWidth(2) = 2000
- .ColWidth(3) = 2000
- .ColWidth(4) = 3000
- .ColWidth(5) = 1500
-
-
-
- .FixedRows = 1
- For i = 1 To 5
- .ColAlignment(i) = 0
- Next i
- .FillStyle = flexFillSingle
- .Col = 0
- .Row = 0
- .RowSel = 1
- .ColSel = .Cols - 1
- .CellAlignment = 4
- .Row = 1
- End With
- End Sub
- Public Sub xuefeishowdata()
- MSF1.Clear
- Dim j As Integer
- Dim i As Integer
- xuefeishowtitle
- MSF1.Rows = 2
- Dim mrc As ADODB.Recordset
- Set mrc = ExecuteSQL(txtsql)
- If mrc.EOF = False Then
- mrc.MoveFirst
- With MSF1
- .Rows = 4
- .Row = 1
- Do While Not mrc.EOF
- .Rows = .Rows + 1
- For i = 1 To mrc.Fields.Count
- .TextMatrix(.Row, i) = mrc.Fields(i - 1)
- Next i
- .Row = .Row + 1
- mrc.MoveNext
- Loop
- End With
- xuefeishowtitle
- Else
-
- If xuefeifind = True Then
- Frmxuefei2.Hide
- Frmxuefei3.Show
- zzz = MsgBox("对不起,没有此班级的学费设置档案记录!", vbOKOnly, "查询")
- Frmxuefei3.ZOrder (0)
- 'Else
- ' With MSF1
- ' .TextMatrix(1, 1) = ""
- '.TextMatrix(1, 2) = ""
- ' .TextMatrix(1, 3) = ""
- ' .TextMatrix(1, 4) = ""
- ' .TextMatrix(1, 5) = ""
- 'End With
- End If
- End If
- mrc.Close
- End Sub
- Private Sub Combo1_Click(Index As Integer)
- If Option1.Value = True Then
- Else
- txtsql = "select * from xuefei where 年级='" & Trim(Combo1(0).Text) & "' and 专业='" & Trim(Combo1(1).Text) & "' and 年制='" & Trim(Combo1(2).Text) & "' and 学期='" & Trim(Combo1(3).Text) & "'"
- xuefeishowdata
- printstr = txtsql
- End If
- 'xuefeishowtitle
- 'xuefeishowdata
-
- End Sub
- Private Sub Form_Activate()
- If xuefeimodi = True Then
- xuefeishowdata
- xuefeimodi = False
- End If
- 'Else
- ' MDIForm1.xfbrowse
- 'End If
- End Sub
- Private Sub Form_Load()
- If Option1.Value = True Then
- txtsql = "select * from xuefei order by 学期,专业,年制"
- For i = 0 To 3
- Combo1(i).Enabled = False
- Next i
- printstr = txtsql
- xuefeishowdata
- End If
- End Sub
- Private Sub Option1_Click()
- For i = 0 To 3
- Combo1(i).Enabled = False
- Next i
- txtsql = "select * from xuefei order by 学期,专业,年制"
- xuefeishowdata
- printstr = txtsql
- End Sub
- Private Sub Option2_Click()
- For i = o To 3
- Combo1(i).Enabled = True
- Next i
- Dim mrc As ADODB.Recordset
-
- txtsql = "select DISTINCT 年级 from xuefei "
- Set mrc = ExecuteSQL(txtsql)
- mrc.MoveFirst
- Combo1(0).Clear
- Do While Not mrc.EOF
- Combo1(0).AddItem mrc.Fields(0)
-
- mrc.MoveNext
- Loop
- Combo1(0).ListIndex = 0
- txtsql = "select DISTINCT 专业 from xuefei"
- Set mrc = ExecuteSQL(txtsql)
- Combo1(1).Clear
- mrc.MoveFirst
-
- Do While Not mrc.EOF
-
- Combo1(1).AddItem mrc.Fields(0)
-
- mrc.MoveNext
- Loop
- Combo1(1).ListIndex = 0
- txtsql = "select DISTINCT 年制 from xuefei"
- Set mrc = ExecuteSQL(txtsql)
- Combo1(2).Clear
- mrc.MoveFirst
-
- Do While Not mrc.EOF
-
- Combo1(2).AddItem mrc.Fields(0)
-
- mrc.MoveNext
- Loop
- Combo1(2).ListIndex = 0
-
- txtsql = "select DISTINCT 学期 from xuefei "
- Set mrc = ExecuteSQL(txtsql)
- Combo1(3).Clear
- mrc.MoveFirst
-
- Do While Not mrc.EOF
-
- Combo1(3).AddItem mrc.Fields(0)
-
- mrc.MoveNext
- Loop
- Combo1(3).ListIndex = 0
- Set mrc = Nothing
- ' xuefeishowtitle
- ' xuefeishowdata
- txtsql = "select * from xuefei where 年级='" & Trim(Combo1(0).Text) & "' and 专业='" & Trim(Combo1(1).Text) & "' and 年制='" & Trim(Combo1(2).Text) & "' and 学期='" & Trim(Combo1(3).Text) & "' order by 学期,专业,年制"
- xuefeishowdata
- printstr = txtsql
- End Sub
- Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Tag
- Case "find"
- Form4.Show
- Case "modi"
- qxstr = Executeqx(3)
- If qxstr = "readonly" Then
- ss = MsgBox("对不起,你是只读用户不能添加记录,请与管理员联系!", vbInformation + vbOKOnly, " 警告")
- Exit Sub
- End If
- xuefeimodi = True
- If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then
- MsgBox "已无记录!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
- ' xuefeimodi = True
- frmxuefei1.Show
- frmxuefei1.xuefeiload
- frmxuefei1.ZOrder 0
- Case "del"
- qxstr = Executeqx(3)
- If qxstr = "readonly" Then
- ss = MsgBox("对不起,你是只读用户不能添加记录,请与管理员联系!", vbInformation + vbOKOnly, " 警告")
- Exit Sub
- End If
- Dim mrc As ADODB.Recordset
- Dim msgtext As String
- Dim intcount As Integer
- If Me.MSF1.Rows > 1 Then
- If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then
- sssss = MsgBox("已无记录!", vbOKOnly + vbExclamation, "警告")
- Exit Sub
- End If
- If MsgBox("确定要删除此记录吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
- intcount = Me.MSF1.Row
- txtsql = "delete from xuefei where 年级='" & Trim(Me.MSF1.TextMatrix(Me.MSF1.Row, 1)) & "' and 专业='" & Trim(Me.MSF1.TextMatrix(Me.MSF1.Row, 2)) & "'and 年制='" & Trim(Me.MSF1.TextMatrix(Me.MSF1.Row, 3)) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(Me.MSF1.Row, 4)) & "'"
- Set mrc = ExecuteSQL(txtsql)
- If Option1.Value = True Then
- txtsql = "select * from xuefei order by 学期,专业,年制"
- Else
- txtsql = "select xuefei.班级,class.年级,class.专业,class.年制,xuefei.学期,xuefei.学费,xuefei.备注 from xuefei inner join class on xuefei.班级=class.班级 order by xuefei.学期 desc, class.年级 desc,class.班级 desc"
- txtsql = "select * from xuefei where 年级='" & Trim(Combo1(0).Text) & "' and 专业='" & Trim(Combo1(1).Text) & "' and 年制='" & Trim(Combo1(2).Text) & "' and 学期='" & Trim(Combo1(3).Text) & "'"
- End If
- xuefeishowdata
- End If
- Else
- MsgBox "你还没有选择记录!", vbExclamation + vbOKOnly, "警告"
- End If
- End Select
- End Sub
- Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
- Select Case ButtonMenu.Key
- Case "dang"
- If Trim(printstr) = "" Then
- sssss = MsgBox("没有当前记录!", vbOKOnly + vbExclamation, "警告")
- Exit Sub
- End If
- If DataEnv1.rsCommand3.State = adStateOpen Then
- DataEnv1.rsCommand3.Close
- End If
- DataEnv1.rsCommand3.Open printstr
- If DataEnv1.rsCommand3.EOF = True Then
- sssss = MsgBox("没有当前记录!", vbOKOnly + vbExclamation, "警告")
- Exit Sub
- End If
- DataReportxuefei.Show 1
- Case "all"
- If DataEnv1.rsCommand3.State = adStateOpen Then
- DataEnv1.rsCommand3.Close
- End If
- DataEnv1.rsCommand3.Open ("select * from xuefei")
- If DataEnv1.rsCommand3.EOF = True Then
- sssss = MsgBox("没有当前记录!", vbOKOnly + vbExclamation, "警告")
- Exit Sub
- End If
- DataReportxuefei.Show 1
- End Select
- End Sub