物流运输管理系统 第5页
4.5 更改运单表单
新建立FRMTRAFFICUPDATE表单,用来更改物流系统的业务表单,通过该表单可以修改业务单据中的各个项目信息。
更改运单窗体的控件及属性取值如下:
控件 属性 属性取值
Label Name lblTitle
Caption 更改运单
Frame Name Frame1
Caption 运输费用(单位:元)
Commandbutton Name cmdmodify
Caption 修改
Name cmdExit
Caption 取消
代码如下:
Private Sub Form_Load()
'调整位置
Me.Top = 0
Me.Left = 0
Me.Width = MainForm.Width * 0.8
Me.Height = MainForm.Height * 0.7
Dim inum As Integer
Dim strsql As String
Dim DB As New clsDataBase
Dim rs As New ADODB.Recordset
'初始化车类型
cmbTrainType.AddItem ("高边")
cmbTrainType.ItemData(0) = 0
cmbTrainType.AddItem ("蓬车")
cmbTrainType.ItemData(1) = 1
'初始化货物类型
cmbProductType.AddItem ("包装")
cmbProductType.ItemData(0) = 0
cmbProductType.AddItem ("散装")
cmbProductType.ItemData(1) = 1
'初始化品名
strsql = "SELECT * FROM PRODUCT"
Set rs = sys.DB.OpenRecordSet(strsql)
If Not (rs.BOF) Or (rs.EOF) Then
inum = 0
Do While Not rs.EOF
cmbProductName.AddItem (rs("NAME"))
cmbProductName.ItemData(inum) = rs("ID")
rs.MoveNext
inum = inum + 1
Loop
End If
'初始化发站
strsql = "SELECT * FROM STATION ORDER BY NAME"
Set rs = sys.DB.OpenRecordSet(strsql)
If Not (rs.BOF) Or (rs.EOF) Then
inum = 0
Do While Not rs.EOF
cmbSendStation.AddItem (rs("NAME"))
cmbSendStation.ItemData(inum) = rs("ID")
rs.MoveNext
inum = inum + 1
Loop
End If
'初始化到站
strsql = "SELECT * FROM STATION ORDER BY NAME DESC"
Set rs = sys.DB.OpenRecordSet(strsql)
If Not (rs.BOF) Or (rs.EOF) Then
inum = 0
Do While Not rs.EOF
cmbReceiveStation.AddItem (rs("NAME"))
cmbReceiveStation.ItemData(inum) = rs("ID")
rs.MoveNext
inum = inum + 1
Loop
End If
'初始化发货人
strsql = "SELECT * FROM CLIENT ORDER BY NAME"
Set rs = sys.DB.OpenRecordSet(strsql)
If Not (rs.BOF) Or (rs.EOF) Then
inum = 0
Do While Not rs.EOF
cmbSender.AddItem (rs("NAME"))
cmbSender.ItemData(inum) = rs("ID")
rs.MoveNext
inum = inum + 1
Loop
End If
'初始化收货人
strsql = "SELECT * FROM CLIENT ORDER BY NAME DESC"
Set rs = sys.DB.OpenRecordSet(strsql)
If Not (rs.BOF) Or (rs.EOF) Then
inum = 0
Do While Not rs.EOF
cmbReceiver.AddItem (rs("NAME"))
cmbReceiver.ItemData(inum) = rs("ID")
rs.MoveNext
inum = inum + 1
Loop
End If
'赋值
strsql = "SELECT * FROM TRAFFIC WHERE ID = " & updateid
Set rs = sys.DB.OpenRecordSet(strsql)
If Not rs.EOF Then
txtId.Text = sys.TextTolong(rs("ID"))
txtCarNum.Text = sys.StrToText(rs("CarNum"))
For inum = 0 To cmbTrainType.ListCount - 1
If cmbTrainType.ItemData(inum) = sys.TextTolong(rs("TrainType")) Then
cmbTrainType.ListIndex = inum
End If
Next
For inum = 0 To cmbProductName.ListCount - 1
If cmbProductName.ItemData(inum) = sys.TextTolong(rs("ProductName")) Then
cmbProductName.ListIndex = inum
End If
Next
If Not IsNull(rs("DateNum")) Then
dtpDateNum.Value = CDate(rs("DateNum"))
Else
dtpDateNum.Value = Date
End If
For inum = 0 To cmbSendStation.ListCount - 1
If cmbSendStation.ItemData(inum) = sys.TextTolong(rs("SendStation")) Then
cmbSendStation.ListIndex = inum
End If
Next
For inum = 0 To cmbReceiveStation.ListCount - 1
If cmbReceiveStation.ItemData(inum) = sys.TextTolong(rs("ReceiveStation")) Then
cmbReceiveStation.ListIndex = inum
End If
Next
For inum = 0 To cmbSender.ListCount - 1
If cmbSender.ItemData(inum) = sys.TextTolong(rs("Sender")) Then
cmbSender.ListIndex = inum
End If
Next
For inum = 0 To cmbReceiver.ListCount - 1
If cmbReceiver.ItemData(inum) = sys.TextTolong(rs("Receiver")) Then
cmbReceiver.ListIndex = inum
End If
Next
For inum = 0 To cmbProductType.ListCount - 1
If cmbProductType.ItemData(inum) = sys.TextTolong(rs("ProductType")) Then
cmbProductType.ListIndex = inum
End If
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页
物流运输管理系统 第5页下载如图片无法显示或论文不完整,请联系qq752018766