VB商场经营管理系统 第4页

VB商场经营管理系统 第4页
相关代码如下:
Private Sub Command2_Click()
Dim res As Integer
res = MsgBox("确定要删除次行记录吗?", vbExclamation + vbYesNo + vbDefaultButton2)
If res = vbYes Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MoveLast
End If
End If
End Sub

Private Sub Command3_Click()
Adodc1.Recordset.Fields("CustomerID") = Trim(Text1.Text)
Adodc1.Recordset.Fields("CardId") = Trim(Text2.Text)
Adodc1.Recordset.Fields("IdentityCard") = Trim(Text3.Text)
Adodc1.Recordset.Fields("CName") = Trim(Text4.Text)
Adodc1.Recordset.Fields("Sex") = Trim(Text5.Text)
Adodc1.Recordset.Fields("Age") = Trim(Text6.Text)
Adodc1.Recordset.Fields("Address") = Trim(Text7.Text)
Adodc1.Recordset.Fields("Postcode") = Trim(Text8.Text)
Adodc1.Recordset.Fields("Tel") = Trim(Text9.Text)
If Command3.Caption = "保存" Then
MsgBox "保存成功"
Command3.Caption = "更新"
Else
  MsgBox "成功更新"
  End If
  Adodc1.Recordset.Update
  Command1.Enabled = True
  Command2.Enabled = True
  Command4.Enabled = False
End Sub

Private Sub Command4_Click()
Adodc1.Recordset.CancelUpdate
Command1.Enabled = True
Command2.Enabled = True
Command4.Enabled = False
Command3.Caption = "更新"
End Sub
 
这个为顾客查找界面,部分代码如下:
Private Sub Command1_Click()
Dim addr As String
Dim sql As String
sql = "select * from Table_Customer where address="
addr = DataCombo1.Text
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = sql + "'" + addr + "'"
Adodc2.Refresh
Set DataGrid1.DataSource = Adodc2
End Sub

Private Sub Command2_Click()
Adodc2.CommandType = adCmdTable
Adodc2.RecordSource = "Table_Customer"
Adodc2.Refresh
Set DataGrid1.DataSource = Adodc2
End Sub
Private Sub Form_Load()
Adodc1.Recordset.MoveFirst
DataCombo1.Text = Adodc1.Recordset.Fields("address")
End Sub
会员卡管理界面
部分代码如下:
Private Sub Command1_Click()
DataGrid1.Enabled = True
DataGrid1.AllowAddNew = True
DataGrid1.AllowUpdate = True
End Sub
Private Sub Command2_Click()
DataGrid1.Enabled = True
DataGrid1.AllowDelete = True
End Sub
Private Sub Command3_Click()
DataGrid1.Enabled = True
DataGrid1.AllowUpdate = True
End Sub
Private Sub Command5_Click()
DataGrid1.AllowAddNew = True
End Sub
商品信息界面
 DataGrid1的相关属性设置:
Allowaddnew=true
Allowarrows= true
Allowdelete=true
Allowupdate=true
Datasource=adodc1
销售人员信息界面

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

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