⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 选修课教材出库.frm

📁 学生教材管理系统:对学校书库进销存进行管理的系统
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            Locked          =   -1  'True
            TabIndex        =   23
            Text            =   "选修课"
            Top             =   1800
            Width           =   1875
         End
         Begin VB.TextBox Text2 
            Height          =   300
            Left            =   1200
            Locked          =   -1  'True
            TabIndex        =   20
            Top             =   720
            Width           =   1875
         End
         Begin VB.TextBox Text3 
            Height          =   300
            Left            =   1200
            Locked          =   -1  'True
            TabIndex        =   19
            Top             =   1260
            Width           =   1875
         End
         Begin VB.TextBox Text1 
            Height          =   300
            Left            =   1200
            Locked          =   -1  'True
            TabIndex        =   18
            Top             =   180
            Width           =   1875
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "课程类别:"
            Height          =   180
            Left            =   300
            TabIndex        =   17
            Top             =   1860
            Width           =   900
         End
         Begin VB.Label Label8 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "总 金 额:"
            Height          =   180
            Left            =   300
            TabIndex        =   12
            Top             =   1365
            Width           =   900
         End
         Begin VB.Label Label7 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "需领本数:"
            Height          =   180
            Left            =   300
            TabIndex        =   11
            Top             =   795
            Width           =   900
         End
         Begin VB.Label Label6 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "单    价:"
            Height          =   180
            Left            =   300
            TabIndex        =   10
            Top             =   300
            Width           =   900
         End
      End
      Begin VB.Frame Frame2 
         Height          =   2235
         Left            =   60
         TabIndex        =   1
         Top             =   4185
         Width           =   3195
         Begin VB.ComboBox Combo4 
            Height          =   300
            ItemData        =   "选修课教材出库.frx":0015
            Left            =   1020
            List            =   "选修课教材出库.frx":0031
            Style           =   2  'Dropdown List
            TabIndex        =   28
            Top             =   1740
            Width           =   1875
         End
         Begin VB.ComboBox Combo3 
            Height          =   300
            Left            =   1020
            TabIndex        =   9
            Top             =   1260
            Width           =   1875
         End
         Begin VB.ComboBox Combo2 
            Height          =   300
            Left            =   1020
            TabIndex        =   8
            Top             =   780
            Width           =   1875
         End
         Begin VB.ComboBox Combo1 
            Height          =   300
            Left            =   1020
            TabIndex        =   7
            Top             =   300
            Width           =   1875
         End
         Begin VB.Label Label14 
            AutoSize        =   -1  'True
            Caption         =   "学期:"
            Height          =   180
            Left            =   420
            TabIndex        =   29
            Top             =   1800
            Width           =   540
         End
         Begin VB.Label Label5 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "教材名:"
            Height          =   180
            Left            =   300
            TabIndex        =   6
            Top             =   1320
            Width           =   720
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "班级名:"
            Height          =   180
            Left            =   300
            TabIndex        =   5
            Top             =   840
            Width           =   720
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "系  名:"
            Height          =   180
            Left            =   300
            TabIndex        =   4
            Top             =   360
            Width           =   720
         End
      End
      Begin VB.Label Label15 
         AutoSize        =   -1  'True
         Caption         =   "如果有人要书请点""要领书人"""
         Height          =   180
         Left            =   60
         TabIndex        =   33
         Top             =   7350
         Width           =   2340
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "asas"
         Height          =   180
         Left            =   7020
         TabIndex        =   32
         Top             =   7350
         Width           =   360
      End
      Begin VB.Label Label13 
         AutoSize        =   -1  'True
         Height          =   180
         Left            =   8700
         TabIndex        =   31
         Top             =   8700
         Width           =   90
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "aaa"
         Height          =   180
         Left            =   3000
         TabIndex        =   30
         Top             =   7350
         Width           =   270
      End
   End
End
Attribute VB_Name = "选修课教材出库"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim tim As Integer, jcsum As Integer, ckcs As Integer

Private Sub Combo1_Click()
    Text2.Text = ""
    Adodc1.RecordSource = "select bj from 学生选修课教材情况表  where xi='" & Trim(Combo1.Text) + "'" + "  group by bj"
    Adodc1.Refresh
    Combo2.Clear
    Do While Not Adodc1.Recordset.EOF
        Combo2.AddItem Adodc1.Recordset.Fields("bj")
        Adodc1.Recordset.MoveNext
    Loop
    Adodc2.RecordSource = "select * from 学生选修课教材情况表 where xi='" & Combo1 + "'"
    Adodc2.Refresh
End Sub

Private Sub Combo2_Click()
    Adodc2.RecordSource = "select * from 学生选修课教材情况表 where bj='" & Combo2 + "'"
    Adodc2.Refresh
    Adodc2.Recordset.MoveFirst
    js = 0
    Do While Not Adodc2.Recordset.EOF
        If Adodc2.Recordset.Fields("是否领书") = "否" Then js = js + 1
        Adodc2.Recordset.MoveNext
    Loop
    Adodc2.Recordset.MoveFirst
    Adodc = Adodc2.Recordset.RecordCount
    Label2.Caption = "此班共有" + Str$(Adodc) + "人,其中有" + Str$(Adodc - js) + "人领书,有" + Str$(js) + "人不领书。"
    Text2.Text = Adodc - js
    Adodc2.Recordset.MoveFirst
    Adodc2.Recordset.Find "是否领书='是'"
    tim = 0
    If Adodc2.Recordset.EOF Then
        tim = 0
    Else
    For i = 0 To 9
        If Adodc2.Recordset.Fields(4 + i) <> "" Then tim = i + 1
    Next
    End If
    Label10.Caption = "已领书" + Str$(tim) + "次!"
    
End Sub

Private Sub Combo3_Click()
    Adodc5.RecordSource = "select * from 教材库存表 where 教材名='" & Combo3 + "'"
    Adodc5.Refresh
    Text1 = Adodc5.Recordset.Fields("单价")
    jcsum = Adodc5.Recordset.Fields("库存数量")
    Label13.Caption = "库存" + Str$(jcsum) + "本书!"
End Sub

Private Sub Command1_Click()
    xuqi = Trim(Combo4.Text)
    If Combo1.Text = "" Or Combo2.Text = "" Or Combo3.Text = "" Or Text1 = "" Or Text2 = "" Or Text3 = "" Or Combo5.Text = "" Or Text5.Text = "" Then
        MsgBox "信息不完整,请输入!", vbOKOnly + vbInformation, "教材出库": Combo5.SetFocus
    Else
    If jcsum < Val(Text2) Then
        MsgBox "库存量不够出库所需求,请入库此书!", vbOKOnly + vbInformation, "教材出库": Combo3.Text = "": Text1 = "": Label13.Caption = ""
    Else
        Adodc2.Recordset.MoveFirst
        Do While Not Adodc2.Recordset.EOF
            If Adodc2.Recordset.Fields("是否领书") = "是" Then
                Adodc2.Recordset.Fields(4 + tim) = Trim(Combo3.Text)
                Adodc2.Recordset.Fields("总金额") = Adodc2.Recordset.Fields("总金额") + Val(Text1.Text)
                Adodc2.Recordset.Fields("学期") = xuqi
                Adodc2.Recordset.Fields("是否领书") = "否"
            End If
            Adodc4.Recordset.MoveFirst
            Adodc4.Recordset.Find "xh='" & Trim(Adodc2.Recordset.Fields("xh")) & "'"
            zje = Adodc4.Recordset.Fields(xuqi)
            hj = Adodc4.Recordset.Fields("合计")
            Adodc4.Recordset.Fields(xuqi) = Adodc2.Recordset.Fields("总金额")
            If Adodc4.Recordset.Fields(xuqi) <> zje Then
                hj = hj + (Adodc4.Recordset.Fields(xuqi) - zje)
            End If
            Adodc4.Recordset.Fields("合计") = hj
            Adodc4.Recordset.Update
            Adodc2.Recordset.MoveNext
        Loop
        Adodc2.Recordset.MoveFirst
        Adodc2.Recordset.Find "是否领书='是'"
        tim = 0
        For i = 0 To 4
            If Adodc2.Recordset.Fields(4 + i) <> "" Then tim = i + 1
        Next
        Label10.Caption = "已领书" + Str$(tim) + "次!"
        
        
        Adodc3.Recordset.AddNew
        Adodc3.Recordset.Fields("教材名") = Trim(Combo3.Text)
        Adodc3.Recordset.Fields("xi") = Trim(Combo1.Text)
        Adodc3.Recordset.Fields("bj") = Trim(Combo2.Text)
        Adodc3.Recordset.Fields("单价") = Trim(Text1.Text)
        Adodc3.Recordset.Fields("数量") = Trim(Text2.Text)
        Adodc3.Recordset.Fields("总金额") = Trim(Text3.Text)
        Adodc3.Recordset.Fields("出库日期") = DTPicker1.Value
        Adodc3.Recordset.Fields("课程类别") = Trim(Text4.Text)
        Adodc3.Recordset.Fields("领书人") = Trim(Text5.Text)
        Adodc3.Recordset.Fields("经手人") = Trim(Combo5.Text)
        Adodc3.Recordset.Update
        
        Adodc5.Recordset.Fields("库存数量") = jcsum - Val(Text2.Text)
        jcsum = Adodc5.Recordset.Fields("库存数量")
        Label13.Caption = "库存" + Str$(jcsum) + "本书!"
        Adodc5.Recordset.Update
        
        
        
        
        a = 0
        For i = 0 To Combo5.ListCount
            If Combo5.List(i) = Combo5.Text Then a = 1
        Next
        If a = 0 Then Combo5.AddItem Combo5.Text
    End If
    End If
End Sub

Private Sub Command4_Click()
    js = 0
    选修课特殊情况处理.Show
End Sub



Private Sub Command5_Click()
    Unload Me
End Sub

Private Sub Command6_Click()
    hh = 2
    教材出库查询.Show
End Sub

Private Sub Form_Load()
    Combo4.ListIndex = 0
    'Adodc2.RecordSource = "select * from 学生选修课教材情况表"
    'Adodc2.Refresh
    'Set DataGrid1.DataSource = Adodc2
    Adodc1.RecordSource = "select xi from 学生选修课教材情况表 group by xi "
    Adodc1.Refresh
    Combo1.Clear
    Do While Not Adodc1.Recordset.EOF
        Combo1.AddItem Adodc1.Recordset.Fields("xi")
        Adodc1.Recordset.MoveNext
    Loop
    Adodc5.RecordSource = "select * from 教材库存表"
    Adodc5.Refresh
    Combo3.Clear
    Do While Not Adodc5.Recordset.EOF
        Combo3.AddItem Adodc5.Recordset.Fields("教材名")
        Adodc5.Recordset.MoveNext
    Loop
End Sub



Private Sub Text1_Change()
    Text3 = Val(Text1) * Val(Text2)
End Sub

Private Sub Text2_Change()
    Text3 = Val(Text1) * Val(Text2)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -