VB+SQLServer2000物流管理系统 第9页


VB+SQLServer2000物流管理系统 第9页

 Call DBGCon

         End If

         Call Tbr_cortrol(Tbr_xxcz, True)

  End If

End Sub

 

Private Sub Edits()     '修改信息的事件过程

    c = MsgBox("确认修改信息吗", 33, "提示信息")

      If c = vbOK Then

          Set AdoRs = Cnn.Execute("UPDATE tb_Goods_cldd SET cldd_id='" + Txt_id + "',cldd_cphm='" + Text1(0) + "',cldd_czxm='" + Text1(1) + "',cldd_sjxm='" + Text1(2) + "',cldd_rwsj='" _

          + STR(DT1.Value) + "',cldd_phmc='" + Text1(4) + "',cldd_shdd='" + Text1(5) + "',cldd_bz='" + Txt_bz + "' where cldd_id='" + Txt_id.Text + "'")

          MsgBox "数据修改成功", 64, "提示信息"

          Adodc1.RecordSource = "select * from tb_Goods_cldd order by cldd_id"

          Adodc1.Refresh

            StrId = Txt_id.Text

            StrTitle = Text1(0).Text

            Call joinRZ

          Call DBGCon

      Else

'      AdoRs.Close

      End If

End Sub

Private Sub LoadFile()

   AdoRs.Open "select * from tb_Goods_cldd", Cnn, adOpenKeyset

     If AdoRs.RecordCount > 0 Then

         Txt_id.Text = AdoRs.Fields("cldd_id")

         Text1(0).Text = AdoRs.Fields("cldd_cphm")

         Text1(1).Text = AdoRs.Fields("cldd_czxm")

         Text1(2).Text = AdoRs.Fields("cldd_sjxm")

         Text1(3).Text = AdoRs.Fields("cldd_zxrw")

         Text1(4).Text = AdoRs.Fields("cldd_phmc")

         DT1.Value = AdoRs.Fields("cldd_rwsj")

         Text1(5).Text = AdoRs.Fields("cldd_shdd")

         Txt_bz.Text = AdoRs.Fields("cldd_bz")

      End If

   AdoRs.Close

End Sub

Private Sub Deletes()                     '删除信息

   c = MsgBox("确认删除该信息吗", 17, "提示信息")

      If c = vbOK Then

         On Error Resume Next

         Set AdoRs = Cnn.Execute("Delete tb_Goods_cldd from tb_Goods_cldd where cldd_id='" + Txt_id.Text + "'")

         Adodc1.Refresh

      End If

      For i = 0 To 5

         Text1(i).Text = ""

      Next i

        Txt_bz.Text = ""

End Sub

Private Sub DBGCon()

    Dgr_Sjll.Columns(0).Caption = "编号"

    Dgr_Sjll.Columns(1).Caption = "车牌号码"

    Dgr_Sjll.Columns(2).Caption = "车主姓名"

    Dgr_Sjll.Columns(3).Caption = "司机姓名"

    Dgr_Sjll.Columns(4).Caption = "执行任务"

    Dgr_Sjll.Columns(5).Caption = "执行任务日期"

    Dgr_Sjll.Columns(6).Caption = "配送货物名称"

    Dgr_Sjll.Columns(7).Caption = "配送地点"

    Dgr_Sjll.Columns(8).Caption = "备注"

End Sub

Private Sub Txt_bz_KeyDown(KeyCode As Integer, Shift As Integer)

  If KeyCode = 38 Then

    Text1(5).SetFocus

  ElseIf KeyCode = 13 Then

    Call Saves

  End If

End Sub

Private Sub Timer1_Timer()

  On Error Resume Next

    Lbl_Num.Caption = "当前数据表中共有 " & Adodc1.Recordset.RecordCount & " 条记录"

End Sub

Private Sub Txt_id_KeyDown(KeyCode As Integer, Shift As Integer)

   If KeyCode = 13 Then

     Adodc1.RecordSource = "select * from tb_Goods_cldd where cldd_id='" + Txt_id.Text + "'"

     Adodc1.Refresh

     If Adodc1.Recordset.RecordCount > 0 Then

        Txt_id.Text = Adodc1.Recordset.Fields("cldd_id")

        Text1(0).Text = Adodc1.Recordset.Fields("cldd_cphm")

        Text1(1).Text = Adodc1.Recordset.Fields("cldd_czxm")

        Text1(2).Text = Adodc1.Recordset.Fields("cldd_sjxm")

        Text1(3).Text = Adodc1.Recordset.Fields("cldd_zxrw")

        Text1(4).Text = Adodc1.Recordset.Fields("cldd_phmc")

        DT1.Value = Adodc1.Recordset.Fields("cldd_rwsj")

        Text1(5).Text = Adodc1.Recordset.Fields("cldd_shdd")

        Txt_bz.Text = Adodc1.Recordset.Fields("cldd_bz")

     End If

     Call DBGCon

   End If

End Sub

5.1.3货运申请单模块的实现

5.3  货运申请单安排

代码如下:

Private Sub Cmd_Cancel_Click()

  Unload Me

End Sub

Private Sub DataGrid1_KeyDown(KeyCode As Integer, Shift As Integer)

      '将相应的数据信息赋值到相应窗体中相对应的文本框当中

'   On Error Resume Next

   If KeyCode = 13 Then

     If StrNums = 0 Then           '将信息赋值给货品出库窗体中的文本框

         Frm_Hpty.Text1(0).Text = Adodc1.Recordset.Fields("sqd_sqdh")

         Frm_Hpty.Text1(2).Text = Adodc1.Recordset.Fields("sqd_zjmc")

         Frm_Hpty.Text1(14).Text = Adodc1.Recordset.Fields("clxx_id")

         Frm_Hpty.Text1(12).Text = Adodc1.Recordset.Fields("clxx_sjxm")

         Frm_Hpty.Text1(13).Text = Adodc1.Recordset.Fields("clxx_cphm")

         Frm_Hpty.Text1(15).Text = Adodc1.Recordset.Fields("clxx_sjsj")

         Frm_Hpty.Text1(18).Text = Adodc1.Recordset.Fields("sqd_yf")

         Frm_Hpty.Text1(1).Text = Adodc1.Recordset.Fields("khxx_mc")

         Frm_Hpty.Text1(4).Text = Adodc1.Recordset.Fields("khxx_lxr")

         Frm_Hpty.Text1(3).Text = Adodc1.Recordset.Fields("khxx_gsdh")

         Unload Me

         Frm_Hpty.Text1(5).SetFocus

     End If

   End If

End Sub

Private Sub Form_Load()

'    rtn = SetWindowPos(Me.hWnd, -1, 0, 0, 0, 0, 3)    '运用API函数SetWindowPos,来实现使窗体置前的功能

Adodc1.ConnectionString = PublicStr

Adodc1.RecordSource = "select * from View_Tyxx"

Adodc1.Refresh

    DataGrid1.Columns(0).Caption = "申请单号"

    DataGrid1.Columns(1).Caption = "主件名称"

    DataGrid1.Columns(2).Caption = "车辆编号"

    DataGrid1.Columns(3).Caption = "司机姓名"

    DataGrid1.Columns(4).Caption = "车牌号码"

    DataGrid1.Columns(5).Caption = "司机手机"

    DataGrid1.Columns(6).Caption = "客户名称"

    DataGrid1.Columns(7).Caption = "联系人"

    DataGrid1.Columns(8).Caption = "单位电话"

    DataGrid1.Columns(9).Visible = False

End Sub

Private Sub Text1_Change()                            '实现模糊查询

  On Error Resume Next

  Adodc1.RecordSource = "select * from view_tyxx where sqd_sqdh like '%" + Text1.Text + "%'"

  Adodc1.Refresh

End Sub

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

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