毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

图书借阅管理系统课程设计报告 第5页

更新时间:2009-9-2:  来源:毕业论文
图书借阅管理系统课程设计报告 第5页
代码:Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim d As Integer
If Not IsNumeric(Text1) Then
MsgBox "输入为空或输入格式不正确!", 64, "提示"
Else
  If Val(Text1.Text) < 1 Or Val(Text2.Text) > 12 Then
    MsgBox "请输入1-12的数字!", 64, "提示"
  Else
     Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书馆"
     Adodc1.RecordSource = "select  借书数目,费用 from 借书卡表"
     Adodc1.Refresh
        If Not Adodc1.Recordset.EOF Then
        a = a + Adodc1.Recordset.Fields("借书数目")
        b = b + Adodc1.Recordset.Fields("费用")
        b = -b
        Adodc1.Recordset.MoveNext
        End If
 
     If Text1.Text = "" Or Text2.Text = "" Then
        MsgBox "输入不完整!", 64, "提示"
     Else
        Adodc1.RecordSource = "select * from 图书信息"
        Adodc1.Refresh
        Do While Not Adodc1.Recordset.EOF
        c = Format(Adodc1.Recordset.Fields("进货日期"), "yyyy,mm,dd")
        If Val(Mid(c, 1, 4)) = Val(Mid(Label4.Caption, 1, 4)) And Mid(c, 6, 2) >= Val(Text1.Text) And Mid(c, 6, 2) <= Val(Text2.Text) Then
        d = d + 1
        End If
        Adodc1.Recordset.MoveNext
        Loop
       
        Adodc1.RecordSource = "select * from 基本信息"
        Adodc1.Refresh
        With Adodc1.Recordset
         .AddNew
         .Fields("借出册数") = a
         .Fields("罚款") = b
         .Fields("新增册数") = d
         .Fields("起始月份") = Text1
         .Fields("截止月份") = Text2
         .Update
        End With
        DataReport1.Show
     End If
  End If
End If
End Sub
 
login.Show
Unload Me
Case "exit"
Unload Me
Case "help"
aboutus.Show
aboutsubject.Show
End Select
End Sub

报表界面:借阅系统界面: 
代码:
Private Sub Command1_Click()
n = MsgBox("确认借出此书!", 64 + 1, "提示")
If n = vbOK Then
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书馆"
Adodc1.RecordSource = "select * from 借书卡表 where 卡号='" & Text1.Text & "'"
Adodc1.Refresh
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox "输入不完整!", 64, "提示"
Else
   If Adodc1.Recordset.EOF Then
    MsgBox "无此卡号!", 48, "警告"
   Else
      If Adodc1.Recordset.Fields("借书数目") = 5 Then
        MsgBox "此卡以达最大借书数目,不能再借书!", 48, "警告"
      Else
        With Adodc1.Recordset
        .Fields("书籍编号") = Text2.Text
        .Fields("借书数目") = .Fields("借书数目") + 1
        .Update
        End With
       
       Adodc1.RecordSource = "select * from 图书信息 where  编号='" & Text2.Text & "'"
       Adodc1.Refresh
         If Adodc1.Recordset.EOF Then
            MsgBox "无此图书编号!", 48, 警告
         Else

            If Adodc1.Recordset.Fields("是否借出") = "是" Then
            MsgBox "此书已借出!!!", 16, "错误"
            Else
With Adodc1.Recordset
            .Fields("是否借出") = "是"
            .Update
            End With
             Adodc1.RecordSource = "select * from 借还信息 "
            Adodc1.Refresh
            With Adodc1.Recordset
            .AddNew
            .Fields("卡号") = Text1.Text
            .Fields("编号") = Text2.Text
            .Fields("借书日期") = Text3.Text
            .Update
            End With
            End If
          End If
        End If
    End If
  End If
End If
End Sub

Private Sub Command2_Click()
 Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书馆"
 Adodc1.RecordSource = "select * from 借还信息 where 卡号='" & Text1.Text & "' and  编号='" & Text2.Text & "'"
 Adodc1.Refresh
If Text1.Text = "" Or Text2.Text = "" Or Text4.Text = "" Then
    MsgBox "输入不完整!", 64, "提示"
Else
   If Adodc1.Recordset.EOF Then
   MsgBox "此卡没有借此书!", 16, "错误"
   Else
    With Adodc1.Recordset
    .Delete
    .Update
    End With
Adodc1.RecordSource = "select * from 图书信息 where 编号='" & Text2.Text & "'"
    Adodc1.Refresh
    With Adodc1.Recordset
   .Fields("是否借出") = "否"
   .Update
    End With
    Adodc1.RecordSource = "select * from 借书卡表 where 卡号='" & Text1.Text & "'"
    Adodc1.Refresh
    With Adodc1.Recordset
    .Fields("借书数目") = .Fields("借书数目") - 1
    .Fields("书籍编号") = "空"
    .Update
    End With
    a = Format(Text3, "yy,mm,dd")
    b = Format(Text4, "yy,mm,dd")
    c = Month(b) - Month(a)
    d = Day(b) - Day(a)
    e = 30 * c + d - 30
      If e > 0 Then
       MsgBox "此书已超期!", 48, "警告"
       With Adodc1.Recordset
       .Fields("超期天数") = e

上一页  [1] [2] [3] [4] [5] [6] 下一页

图书借阅管理系统课程设计报告 第5页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。