“更新”按钮主要代码:
If mycon.State = ConnectionState.Closed Then
mycon.Open()
End If
Dim ID2 As New SqlParameter("@ID2", SqlDbType.Int, 4)
ID2.Value = ID1
Dim sqlstr As String = "update Book set Name='" & ComboBox1.Text & "' ,Anchor='" & TextBox1.Text & "',Publisher='" & TextBox2.Text & "',Price='" & TextBox3.Text & "',PublishDate='" & TextBox4.Text & "' Where ID=@ID2 and Flag='0'"
Dim mycom As New SqlCommand(sqlstr, mycon)
mycom.Parameters.Add(ID2)
mycom.ExecuteNonQuery()
MessageBox.Show("更新成功!", "恭喜", MessageBoxButtons.OK, MessageBoxIcon.Information)
mycon.Close()
7读者增加窗口实现如下:
图8读者增加窗口界面
在此窗口中管理员可以受动输入读者信息来增加读者
新增读者中包含的项目如下:
学号 姓名 性别 最大借阅册数 最大借阅天数
在“增加”按钮中的主要代码为:
If IsCheckSno() = False Then
MessageBox.Show("你输入的学号不正确,请重新输入", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Warning)
TextBox1.Text = ""
Exit Sub
End If
If mycon.State = ConnectionState.Closed Then
mycon.Open()
End If
Dim sqlstr As String = "insert into Students(SID,Sno,SName,Sex,MaxNumber,MaxDays,RemainNumber) Values(@ID,'" & TextBox1.Text & "','" & TextBox2.Text & "',@Sex,'" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox3.Text & "')"
Dim mycom1 As New SqlCommand(sqlstr, mycon)
mycom1.Parameters.Add(ID)
 
首页 上一页 4 5 6 7 8 9 下一页 尾页 7/9/9
免费图书管理系统(七)由毕业论文网(www.huoyuandh.com)会员上传。