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

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

更新时间:2009-9-2:  来源:毕业论文
图书借阅管理系统课程设计报告 第4页
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
       .Fields("费用") = .Fields("费用") - 0.5 * e
       .Update
       End With
       End If
   MsgBox "此书已还回!", 64, "提示"
   End If
End If
End Sub

Private Sub Command3_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
Set Text3.DataSource = Adodc1
Text3.DataField = "借书日期"
 End Sub

Private Sub Command4_Click()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书馆"
Adodc1.RecordSource = "select * from 借书卡表 where 卡号='" & Text1.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "无此借书卡!", 48, "警告"
Else
MsgBox "此借书卡费用为" & Trim(Adodc1.Recordset.Fields("费用")) & "元!", 64, "费用查询"
End If
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "denglu"
login.Show
Unload Me
Case "chayue"
mes_search.Show
Unload Me
Case "jieyue"
login.Show
Unload Me
Case "guanli"
login.Show
Unload Me
Case "jieshuka"
login.Show
Unload Me
Case "exit"
Unload Me
Case "help"
aboutus.Show
aboutsubject.Show
End Select
End Sub报表生成系统界面:

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

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

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