VB+SQL书店图书管理系统(任务书+开题报告+论文) 第16页

VB+SQL书店图书管理系统(任务书+开题报告+论文) 第16页
Adodc1.Recordset!姓名 = TxtUName.Text
If OptionMan.Value Then
    Adodc1.Recordset!性别 = "男"
Else
    Adodc1.Recordset!性别 = "女"
End If
Adodc1.Recordset!地址 = TxtUDiZhi.Text
Adodc1.Recordset!手机 = TxtUDanWei.Text
Adodc1.Recordset!电子邮件 = TxtUMail.Text
Adodc1.Recordset!电话 = TxtUDianHua.Text
Adodc1.Recordset!人生格言 = TxtUMemo.Text
Adodc1.Recordset!创建日期 = Now()
Adodc1.Recordset.Update

Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "Admin"
Adodc1.Refresh

Adodc1.Recordset.AddNew
Adodc1.Recordset!用户ID = TxtCard.Text
Adodc1.Recordset!用户密码 = TxtCard.Text
Adodc1.Recordset!用户身份 = ComboShenFen.Text
Adodc1.Recordset.Update

CommitTrans

MsgBox "恭喜你,注册成功!" & vbCrLf & "员工的帐号和密码就是你填写的员工帐号!" & vbCrLf & "请员工自行修改密码或立即修改密码。", vbOKOnly + vbQuestion, "注册成功"
TxtCard.Text = ""
TxtUName.Text = ""
TxtUDanWei.Text = ""
TxtUDiZhi.Text = ""
TxtUMail.Text = ""
TxtUDianHua.Text = ""
TxtUMemo.Text = ""
CmdRegMe.Enabled = True

Exit Sub

errEnd:
    Rollback
    MsgBox "注册失败,操作数据库发生错误!", vbOKOnly + vbExclamation, "注册失败"
    CmdRegMe.Enabled = True
End Sub

模块名:GetJinJia
模块原型:Public Function GetJinJia(bianHao As String) As String
代码:
Public Function GetJinJia(bianHao As String) As String
On Error GoTo errEnd

Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select [单价] from [进书记录] where [图书编号]=""" & TuShuBianHao & """"
Adodc1.Refresh

If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Recordset.MoveFirst
    GetJinJia = Adodc1.Recordset!单价 & ""
Else
    MsgBox "数据丢失,清重试!", vbOKOnly + vbExclamation, "办理退货"
    GetJinJia = ""
    Exit Function
End If

Exit Function
errEnd:
    MsgBox "找不到该品种的进价!", vbOKOnly + vbExclamation, "检索数据库出错"
    GetJinJia = ""
End Function

模块名:CmdTH_Click
模块原型:Private Sub CmdTH_Click()
代码:
Private Sub CmdTH_Click()
On Error GoTo errEnd
Dim QD As Integer

If TxtShuLiang.Text = "" Then
    MsgBox "请填写退货的数量.", vbOKOnly + vbExclamation, "办理退货"
    TxtShuLiang.SetFocus
    Exit Sub
End If

Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from [Book] where [图书编号]=""" & TuShuBianHao & """"
Adodc1.Refresh

If Adodc1.Recordset.RecordCount = 0 Then
    MsgBox "数据丢失,清重试!", vbOKOnly + vbExclamation, "办理退货"
    Exit Sub
End If

Adodc1.Recordset.MoveFirst
If Adodc1.Recordset!库存量 - CInt(TxtShuLiang.Text) < 0 Then
    MsgBox "库存不足,没有足够的图书可以退回!", vbOKOnly + vbExclamation, "库存不足"
    TxtShuLiang.SetFocus
    TxtShuLiang.SelStart = 0
    TxtShuLiang.SelLength = Len(TxtShuLiang.Text)
    Exit Sub
End If

If TxtJinJia.Text = "" Then
    MsgBox "图书进价信息丢失,无法完成退货操作!", vbOKOnly + vbExclamation, "办理退货"
    TxtShuLiang.SetFocus
    Exit Sub
End If
If TxtJinE.Text = "" Then
    MsgBox "请填写退货金额.", vbOKOnly + vbExclamation, "办理退货"
    TxtJinE.SetFocus
    Exit Sub
End If
If TxtYuanYin.Text = "" Then
    MsgBox "请填写退货原因.", vbOKOnly + vbExclamation, "办理退货"
    TxtYuanYin.SetFocus
    Exit Sub
End If
If TxtMemo.Text = "" Then TxtMemo.Text = "无"

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

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有