⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_cgdd.frm

📁 近期学习中的采购管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      End
      Begin VB.TextBox Text2 
         Height          =   300
         Left            =   3240
         Locked          =   -1  'True
         TabIndex        =   12
         Top             =   240
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Left            =   1005
         TabIndex        =   4
         Top             =   240
         Width           =   1335
      End
      Begin VB.Label Label12 
         Caption         =   "金额"
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   5880
         TabIndex        =   34
         Top             =   1080
         Width           =   495
      End
      Begin VB.Label Label11 
         BackStyle       =   0  'Transparent
         Caption         =   "备注"
         ForeColor       =   &H00C00000&
         Height          =   200
         Left            =   2400
         TabIndex        =   28
         Top             =   1440
         Width           =   615
      End
      Begin VB.Label Label10 
         BackStyle       =   0  'Transparent
         Caption         =   "币种"
         ForeColor       =   &H00C00000&
         Height          =   200
         Left            =   120
         TabIndex        =   27
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label Label9 
         BackStyle       =   0  'Transparent
         Caption         =   "数量"
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   4200
         TabIndex        =   24
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label Label8 
         BackStyle       =   0  'Transparent
         Caption         =   "单价"
         ForeColor       =   &H00C00000&
         Height          =   375
         Left            =   2400
         TabIndex        =   23
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label Label7 
         BackStyle       =   0  'Transparent
         Caption         =   "单位"
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   120
         TabIndex        =   21
         Top             =   1080
         Width           =   615
      End
      Begin VB.Label Label6 
         BackStyle       =   0  'Transparent
         Caption         =   "发单日期"
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   4920
         TabIndex        =   20
         Top             =   720
         Width           =   855
      End
      Begin VB.Label Label5 
         BackStyle       =   0  'Transparent
         Caption         =   "收货日期"
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   2400
         TabIndex        =   19
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "供应商编号"
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   100
         TabIndex        =   15
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "批号"
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   4920
         TabIndex        =   13
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "货物名称"
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   2400
         TabIndex        =   11
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "单号"
         ForeColor       =   &H00C00000&
         Height          =   375
         Left            =   120
         TabIndex        =   3
         Top             =   360
         Width           =   1215
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   1440
      Top             =   2640
      Width           =   4335
      _ExtentX        =   7646
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=cggl"
      OLEDBString     =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=cggl"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from Table_cgdd"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "frm_cgdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim c
Private Sub Cmd_add_Click()    '增加采购订单信息
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Text1.Locked = True
Cmd_save.Enabled = True
Cmd_add.Enabled = False
Dim temp1
temp1 = Format(Now, "yyyymmdd")
Adodc1.RecordSource = "select * from Table_cgdd where 单号 like '%" + temp1 + "%'order by 单号"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1.Text = Adodc1.Recordset.Fields("单号")
Text1.Text = Val(Adodc1.Recordset.Fields("单号")) + 1
Else
Text1.Text = Format(Now, "yyyymmdd")
Text1.Text = Text1.Text + "0000"
End If
Adodc1.RecordSource = "select * from Table_cgdd order by 单号"
Adodc1.Refresh
Text2.SetFocus
End Sub

Private Sub Cmd_cancel_Click()
Text1.Locked = False
Cmd_del.Enabled = False
Cmd_save.Enabled = False
Cmd_add.Enabled = True
Cmd_edit.Enabled = False
Call Cmd_add_Click
End Sub

Private Sub Cmd_del_Click()     '删除采购订单信息
Adodc1.RecordSource = "select * from Table_cgdd"
If Adodc1.Recordset.RecordCount > 0 Then
c = MsgBox("确认要删除该信息吗?", 17, "采购管理系统")
If c = vbOK Then
Adodc1.Recordset.Delete
Else
End If
Else
MsgBox "数据库中的信息为空,没有可删除的信息!!", 64, "采购管理系统"
End If
End Sub

Private Sub Cmd_edit_Click()
Call main
  c = MsgBox("确认要修改该信息吗?", 33, "采购管理系统")
  If c = vbOK Then
  Adodc1.Recordset.Delete
  Check1.Value = 0
temp = "订单"
  Set adoRs = adoCon.Execute("insert into Table_cgdd values(" & Text1 & ",'" & Text2 & "','" & Text3 & "','" & Combo1 & "','" & DT1 & "','" & DT2 & "','" & Combo3 & "','" & Combo2 & "','" & Text5 & "','" & Text6 & "','" & Text8 & "','" & Text7 & "','" & Check1 & "','" & temp & "')")
  MsgBox "数据修改成功!!", 64, "采购管理系统"
  Cmd_edit.Enabled = False
  Else
  End If
  Adodc1.RecordSource = "select * from Table_cgdd order by 单号"
  Adodc1.Refresh
adoCon.Close
End Sub

Private Sub Cmd_exit_Click()
Unload Me
End Sub

Private Sub Cmd_refurbish_Click()
Unload Me
frm_cgclgl.Refresh
frm_cgclgl.Show
End Sub

Private Sub Cmd_save_Click()
Call main
If Combo1.Text = "" Then
MsgBox "供应商编号不能为空值!!"
Combo1.SetFocus
Else
Adodc1.RecordSource = "select * from Table_cgdd where 单号='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
c = MsgBox("确认要保存该信息吗?", 33, "采购管理系统")
If c = vbOK Then
Check1.Value = 0
Dim temp
temp = "订单"
  Set adoRs = adoCon.Execute("insert into Table_cgdd values(" & Text1 & ",'" & Text2 & "','" & Text3 & "','" & Combo1 & "','" & DT1 & "','" & DT2 & "','" & Combo3 & "','" & Combo2 & "','" & Text5 & "','" & Text6 & "','" & Text8 & "','" & Text7 & "','" & Check1 & "','" & temp & "')")
  MsgBox "数据保存成功!!", 32, "采购管理系统"
  Cmd_save.Enabled = False
  Cmd_add.Enabled = True
Else
End If
Else
MsgBox "对不起,该信息已经保存过,不能够再进行保存", 64, "采购管理系统"
End If
End If
Adodc1.RecordSource = "select * from Table_cgdd order by 单号"
Adodc1.Refresh
adoCon.Close
End Sub

Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = 13 Then
' If Not IsNumeric(Combo1.Text) Then
' MsgBox "输入必须为数值型数据"
' Else
' End If
  DT1.SetFocus
  Else
  End If
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub
Private Sub Combo3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text5.SetFocus
Else
End If
End Sub

Private Sub DataGrid1_DblClick()
frm_ylhwdd.Show
frm_ylhwdd.Adodc1.RecordSource = "select * from Table_cgdd where 单号='" + txt_dh + "'"
frm_ylhwdd.Adodc1.Refresh
End Sub

Private Sub DT1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DT2.SetFocus
Else
End If
End Sub

Private Sub DT2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo3.SetFocus
Else
End If
End Sub

Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
DT1.Value = Date
DT2.Value = Date
frm_main.StatusBar1.Panels(1).Text = " 当前操作: " & Me.Caption
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
   If Not IsNumeric(Text1.Text) Then
   MsgBox "输入的采购员编号必须为数字"
   Else
      Adodc1.RecordSource = "select * from Table_cgdd where 单号='" + Text1.Text + "'"
      Adodc1.Refresh
      If Adodc1.Recordset.RecordCount > 0 Then
      Cmd_del.Enabled = True
      Cmd_save.Enabled = True
      Cmd_edit.Enabled = True
      Text1.Text = Adodc1.Recordset.Fields("单号")
      Text2.Text = Adodc1.Recordset.Fields("货物名称")
      Text3.Text = Adodc1.Recordset.Fields("批号")
      Text5.Text = Adodc1.Recordset.Fields("单价")
      Text6.Text = Adodc1.Recordset.Fields("数量")
      Text7.Text = Adodc1.Recordset.Fields("备注")
      Text8.Text = Adodc1.Recordset.Fields("金额")
      DT1.Value = Adodc1.Recordset.Fields("收货日期")
      DT2.Value = Adodc1.Recordset.Fields("发单时间")
      Combo1.Text = Adodc1.Recordset.Fields("供应商编号")
      Combo2.Text = Adodc1.Recordset.Fields("币种")
      Combo3.Text = Adodc1.Recordset.Fields("单位")
      Else
      MsgBox "没有该采购员的信息!!", 64, "采购管理系统"
      End If
   End If
Else
End If
End Sub

Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DT1.SetFocus
Else
End If
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
frm_cgclgl_temp.Show
frm_cgclgl_temp.DataGrid1.SetFocus
Else
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo1.SetFocus
Else
End If
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub

Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Not IsNumeric(Text5.Text) Then
 MsgBox "输入的数量信息必须为数值型数据"
Text5.Text = ""
Text5.SetFocus
Else
Text6.SetFocus
End If
Else
End If
End Sub

Private Sub Text6_Change()
Text8.Text = Val(Text5.Text) * Val(Text6.Text)
End Sub

Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo2.SetFocus
Else
End If
End Sub

Private Sub Text6_LostFocus()
If Not IsNumeric(Text6.Text) Then
 MsgBox "输入的数量信息必须为数值型数据"
Text6.Text = ""
Text6.SetFocus
Else
End If
End Sub

Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Cmd_save_Click
Else
End If
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text5.SetFocus
Else
End If
End Sub

Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
  frm_cgyxx_temp.Show
  frm_cgyxx_temp.DataGrid1.SetFocus
Else
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
  frm_main.StatusBar1.Panels(1).Text = " 吉林省明日科技有限公司"
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -