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

SQL+VB图书管理系统(数据库+源代码+论文) 第12页

更新时间:2009-6-3:  来源:毕业论文
SQL+VB图书管理系统(数据库+源代码+论文) 第12页
ShowData sql2, Me.MSFlexGrid3
  
   If Int(Me.MSFlexGrid2.TextMatrix(Me.MSFlexGrid2.Row, 0)) >= Int(Me.MSFlexGrid3.TextMatrix(Me.MSFlexGrid3.Row, 2)) Then
     Me.Txt_zeng.Text = Me.MSFlexGrid3.TextMatrix(Me.MSFlexGrid3.Row, 2)
   Else
     Me.Txt_zeng.Text = Me.MSFlexGrid2.TextMatrix(Me.MSFlexGrid2.Row, 0)
   End If
  
   Call RiQi
  
   Me.Txt_yhsj.Text = Me.Txt_year1.Text & "-" & Me.Txt_month1.Text & "-" & Me.Txt_day1
End Sub

Private Sub Form_Resize()
UpDown1.Value = Int(Txt_xjcs.Text) - 1
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim sql As String, sql1 As String, sql2 As String, sql3 As String, rtn As Long
Select Case Button.Index
Case 3
    If Trim(Txt_jybh.Text) = "" Then
      MsgBox "请填写借阅编号!", vbOKOnly + vbInformation, "提示"
      Exit Sub
    End If
    sql = "insert into 图书借阅 values('" + Trim(Txt_jybh.Text) + "','" + Trim(Txt_tsid.Text) + "','" _
        + Trim(Txt_jszh.Text) + "','" + Trim(Txt_jysj.Text) + "','" + Trim(Txt_yhsj.Text) + "','" _
        + Trim(Txt_czy.Text) + "','" + Trim(Txt_xjcs.Text) + "','" + Trim(Txt_bz.Text) + "')"
    rtn = Update(sql)
    If rtn = 0 Then
        MsgBox "借书成功!", vbOKOnly + vbInformation, "信息"
       
        sql = "select 状态,现存量,借出量 from 图书信息 where 图书ID='" + Me.Txt_tsid.Text + "'"
        ShowData sql, Me.MSFlexGrid2
       
        sql1 = "update 图书信息 set 现存量='" & (Int(Me.MSFlexGrid2.TextMatrix(Me.MSFlexGrid2.Row, 1)) - 1) & "',借出量='" _
             & (Int(Me.MSFlexGrid2.TextMatrix(Me.MSFlexGrid2.Row, 2)) + 1) & "' where 图书ID='" + Me.Txt_tsid.Text + "'"
        Update (sql1)
        Me.MSFlexGrid2.Clear
        Me.MSFlexGrid2.Cols = 2
        Me.MSFlexGrid2.Rows = 2
       
        sql2 = "select 状态,现存量 from 图书信息 where 图书ID='" + Me.Txt_tsid.Text + "'"
        ShowData sql, Me.MSFlexGrid2
       
        If Trim(Me.MSFlexGrid2.TextMatrix(Me.MSFlexGrid2.Row, 1)) = 0 Then
          sql3 = "update 图书信息 set 状态='借出' where 图书ID='" + Me.Txt_tsid.Text + "'"
          Update (sql3)
        End If
       
        Me.MSFlexGrid2.Clear
        Me.MSFlexGrid2.Cols = 2
        Me.MSFlexGrid2.Rows = 2
    ElseIf rtn = -2147217873 Then
       MsgBox "借阅编号已存在!请重新输入!"
       Txt_jybh.Text = ""
       Txt_jybh.SetFocus
    ElseIf rtn = -2147217833 Then
       MsgBox "输入信息超过指定长度!请重新输入!"
    ElseIf rtn = -2147217900 Then
       MsgBox "请不要输入单引号等非法字符!"
    Else
       MsgBox "出现系统错误!请重启本系统!"
    End If
Case 5
       sql = "select * from 图书借阅"
       ShowData sql, Me.MSFlexGrid1
       Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
      
       sql1 = "select * from 图书借阅 where 借书证号='" + Frm_jhx.Txt_jszh.Text + "'"
       ShowData sql1, Frm_jhx.MSFlexGrid1
       Frm_jhx.StatusBar1.Panels(1).Text = "总共有" & Frm_jhx.MSFlexGrid1.Rows - 1 & "条记录"
Case 7
    Unload Me
End Select
End Sub

Private Sub UpDown1_Change()
Txt_xjcs.Text = UpDown1.Value + 1
End Sub

Private Function RiQi()
  Dim day As Integer, day1 As Integer
  Dim month As Integer, month1 As Integer
  Dim year As Integer
 
  Select Case Int(Me.Txt_month.Text)
            Case 1, 3, 5, 7, 8, 10, 12
                day = Int(Me.Txt_day.Text) + Int(Me.Txt_zeng.Text)
                If day > 31 Then
                    day1 = day Mod 31
                    month = Int(Me.Txt_month.Text) + day \ 31
                    Me.Txt_day1.Text = day1
                    Me.Txt_month1.Text = month
                Else
                    Me.Txt_day1.Text = day
                    Exit Function
                End If

 << 上一页  [11] [12] [13] [14] [15] [16] 下一页

SQL+VB图书管理系统(数据库+源代码+论文) 第12页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

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