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

📄 frmnewequipment.frm

📁 一个vb编的计算机机房管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmNewequipment 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "新设备操作"
   ClientHeight    =   4905
   ClientLeft      =   45
   ClientTop       =   315
   ClientWidth     =   6780
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   4905
   ScaleWidth      =   6780
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmddelete 
      Caption         =   "调出"
      Height          =   375
      Left            =   1560
      TabIndex        =   32
      Top             =   4320
      Width           =   855
   End
   Begin VB.CommandButton cmdmodify 
      Caption         =   "修改"
      Height          =   375
      Left            =   4320
      TabIndex        =   29
      Top             =   4320
      Width           =   855
   End
   Begin VB.CommandButton cmdquery 
      Caption         =   "查询"
      Height          =   375
      Left            =   3240
      TabIndex        =   14
      Top             =   4320
      Width           =   855
   End
   Begin VB.Frame Frame1 
      Height          =   4095
      Left            =   120
      TabIndex        =   15
      Top             =   120
      Width           =   6495
      Begin VB.TextBox txtlinkman 
         Height          =   270
         Left            =   2880
         TabIndex        =   31
         Top             =   2280
         Width           =   1455
      End
      Begin VB.TextBox txtmemo 
         Height          =   1215
         Left            =   840
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   12
         Top             =   2760
         Width           =   5295
      End
      Begin VB.TextBox txttel 
         Height          =   270
         Left            =   840
         MaxLength       =   12
         TabIndex        =   9
         Top             =   2280
         Width           =   1215
      End
      Begin VB.TextBox txtsaftmonth 
         Height          =   270
         Left            =   5760
         MaxLength       =   2
         TabIndex        =   11
         Top             =   2280
         Width           =   255
      End
      Begin VB.TextBox txtsaftyear 
         Height          =   270
         Left            =   5040
         TabIndex        =   10
         Top             =   2280
         Width           =   495
      End
      Begin VB.TextBox txtbargainor 
         Height          =   270
         Left            =   840
         TabIndex        =   8
         Top             =   1800
         Width           =   5295
      End
      Begin VB.CommandButton cmdstroreidquery 
         Caption         =   "查询"
         Height          =   300
         Left            =   5520
         TabIndex        =   6
         Top             =   840
         Width           =   600
      End
      Begin VB.ComboBox Cmbstoreid 
         Height          =   300
         Left            =   4440
         TabIndex        =   5
         Top             =   840
         Width           =   855
      End
      Begin VB.TextBox txtccount 
         Height          =   270
         Left            =   840
         TabIndex        =   3
         Top             =   840
         Width           =   735
      End
      Begin VB.TextBox txtvalue 
         Height          =   270
         Left            =   2160
         TabIndex        =   4
         Top             =   840
         Width           =   1095
      End
      Begin VB.TextBox txtbrand 
         Height          =   270
         Left            =   840
         TabIndex        =   7
         Top             =   1320
         Width           =   5295
      End
      Begin VB.CommandButton cmdconfigidquery 
         Caption         =   "查询"
         Height          =   300
         Left            =   5520
         TabIndex        =   2
         Top             =   360
         Width           =   600
      End
      Begin VB.ComboBox CmbConfigid 
         Height          =   300
         Left            =   4440
         TabIndex        =   1
         Top             =   360
         Width           =   855
      End
      Begin VB.TextBox txtname 
         Height          =   270
         Left            =   840
         TabIndex        =   0
         Top             =   360
         Width           =   2415
      End
      Begin VB.Label Label13 
         AutoSize        =   -1  'True
         Caption         =   "联系人"
         Height          =   180
         Left            =   2280
         TabIndex        =   30
         Top             =   2300
         Width           =   540
      End
      Begin VB.Label Label12 
         AutoSize        =   -1  'True
         Caption         =   "备注"
         Height          =   180
         Left            =   360
         TabIndex        =   28
         Top             =   2775
         Width           =   360
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "电话"
         Height          =   180
         Left            =   360
         TabIndex        =   27
         Top             =   2295
         Width           =   360
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "月"
         Height          =   180
         Left            =   6000
         TabIndex        =   26
         Top             =   2300
         Width           =   180
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         Caption         =   "年"
         Height          =   180
         Left            =   5520
         TabIndex        =   25
         Top             =   2300
         Width           =   180
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "保修期"
         Height          =   180
         Left            =   4440
         TabIndex        =   24
         Top             =   2300
         Width           =   540
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "卖商"
         Height          =   180
         Left            =   360
         TabIndex        =   23
         Top             =   1815
         Width           =   360
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "存放地"
         Height          =   180
         Left            =   3765
         TabIndex        =   22
         Top             =   855
         Width           =   540
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "数量"
         Height          =   180
         Left            =   360
         TabIndex        =   21
         Top             =   855
         Width           =   360
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "单价"
         Height          =   180
         Left            =   1680
         TabIndex        =   20
         Top             =   855
         Width           =   360
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "品牌"
         Height          =   180
         Left            =   360
         TabIndex        =   19
         Top             =   1335
         Width           =   360
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "配置编号"
         Height          =   180
         Left            =   3600
         TabIndex        =   18
         Top             =   375
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "设备名"
         Height          =   180
         Left            =   240
         TabIndex        =   17
         Top             =   375
         Width           =   540
      End
   End
   Begin VB.CommandButton cmdback 
      Caption         =   "返回"
      Height          =   375
      Left            =   5400
      TabIndex        =   16
      Top             =   4320
      Width           =   855
   End
   Begin VB.CommandButton cmdadd 
      Caption         =   "调入"
      Height          =   375
      Left            =   360
      TabIndex        =   13
      Top             =   4320
      Width           =   855
   End
End
Attribute VB_Name = "frmNewequipment"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub CmbConfigIDShow()
CmbConfigID.Clear
Connect "r"
sqlstr = "config"
rs.Open sqlstr
Do While Not rs.EOF
 CmbConfigID.AddItem (rs.Fields("configid"))
 rs.MoveNext
Loop
Disconnect

End Sub
Private Sub CmbStoreidShow()
    cmbStoreID.Clear
    Dim s As store
    Dim storeids() As String
    Set s = New store
    storeids = s.GetStoreids()
    If UBound(storeids) > 1 Then
        For i = 1 To UBound(storeids) - 1
            cmbStoreID.AddItem (storeids(i))
        Next
    End If
End Sub
Private Sub CmbConfigid_GotFocus()
CmbConfigIDShow
End Sub
Private Sub Cmbstoreid_GotFocus()
    CmbStoreidShow
End Sub

Private Sub cmdAdd_Click()
Dim n As newequipment
Dim sl As slog
Set sl = New slog
Set n = New newequipment
If Me.cmdAdd.Caption = "调入" Then
 Form_Init
 txtname.SetFocus
 Me.cmdAdd.Caption = "提交"
 Me.CmdQuery.Enabled = False
 CmdModify.Enabled = False
 Me.cmdDelete.Enabled = False
Else
 Me.cmdAdd.Caption = "调入"
 Me.CmdQuery.Enabled = True
 CmdModify.Enabled = True
 Me.cmdDelete.Enabled = True
 '把表单上的数据写入类的属性中
 If txtname.Text = "" Then
  MsgBox "无设备名称"
  Set n = Nothing
  Exit Sub
 End If
 n.name = Trim(txtname.Text)
 If CmbConfigID.Text = "" Then
  MsgBox "无配置编号 "
  Set n = Nothing
  Exit Sub
 End If
 n.configid = CInt(CmbConfigID.Text)
 n.buytime = Date
 n.brand = txtBrand.Text
 n.value = CCur(txtvalue.Text)
 n.ccount = CInt(txtccount.Text)
 n.bargainor = txtbargainor.Text
 n.linkman = txtlinkman.Text
 If txtsaftyear.Text <> "" Then
  n.safttime = CInt(txtsaftyear.Text)
 End If
 If txtsaftmonth.Text <> "" Then
  n.safttime = n.safttime + CInt(txtsaftmonth.Text) / 12
 End If
 n.tel = txttel.Text
 n.memo = txtmemo.Text
 If cmbStoreID.Text = "" Then
  MsgBox "没有选择存放地点"
  Set n = Nothing
  Exit Sub
 End If
 n.STOREID = Trim(cmbStoreID.Text)
 n.Insert
 sl.STOREID = cmbStoreID.Text
 sl.operator = "admin"
 sl.move = True
 sl.mtime = Date
 sl.moveinfo = "设备名称:" & n.name & "|配置类型:" & n.configid & "|单价:" & n.value & "|数量:" & n.ccount & "|存放地点:" & n.STOREID
 sl.Insert
 
 '往slog中写入纪录
 
 
End If
Set sl = Nothing
Set n = Nothing
End Sub

Private Sub CmdBack_Click()
If Me.cmdAdd.Caption = "提交" Then
 Me.cmdAdd.Caption = "调入"
 CmdModify.Enabled = True
 Me.CmdQuery.Enabled = True
 Me.cmdDelete.Enabled = True
ElseIf Me.CmdQuery.Caption = "提交" Then
 Me.cmdAdd.Enabled = True
 CmdModify.Enabled = True
 Me.cmdDelete.Enabled = True
 Me.CmdQuery.Caption = "查询"
ElseIf Me.CmdModify.Caption = "提交" Then
 Me.CmdModify.Caption = "修改"
 cmdAdd.Enabled = True
 CmdQuery.Enabled = True
 Me.cmdDelete.Enabled = True
ElseIf Me.cmdDelete.Caption = "提交" Then
    Me.cmdAdd.Enabled = True
    Me.CmdModify.Enabled = True
    Me.CmdQuery.Enabled = True
    Me.cmdDelete.Caption = "调出"
Else
 Unload Me
End If
End Sub

Private Sub cmdconfigidquery_Click()
 frmconfig.Show
End Sub

Private Sub cmdDelete_Click()
'    frmeselect.Visible = True    '显示查询窗口
'    Form_Paint
'    If Me.cmdDelete.Caption = "调出" Then
'        Me.cmdDelete.Caption = "提交"
'        Me.cmdAdd.Enabled = False
'        Me.CmdModify.Enabled = False
'        Me.CmdQuery.Enabled = False
'    Else
'        Me.cmdDelete.Caption = "调出"
'        Me.cmdAdd.Enabled = True
'        Me.CmdModify.Enabled = True
'        Me.CmdQuery.Enabled = True
'        '修改该记录条的数量字段,若数量字段<=0,则删除该条记录
'
'
'        '往slog中写入纪录
'
'
'    End If
Me.Hide
frmEquipment.Show
End Sub

Private Sub cmdModify_Click()
Dim n As newequipment
If Me.CmdModify.Caption = "修改" Then
 CmdModify.Caption = "提交"
 cmdAdd.Enabled = False
 CmdQuery.Enabled = False
 txtname.SetFocus
Else
 Me.CmdModify.Caption = "修改"
 cmdAdd.Enabled = True
 CmdQuery.Enabled = True
 '提交数据,记得刷新frmeselect
 Set n = New newequipment
 n.nid = CInt(Me.Frame1.Caption)
 If txtname.Text = "" Then
  MsgBox "无设备名称"
  Set n = Nothing
  Exit Sub
 End If
 n.name = Trim(txtname.Text)
 If CmbConfigID.Text = "" Then
  MsgBox "无配置编号 "
  Set n = Nothing
  Exit Sub
 End If
 n.configid = CInt(CmbConfigID.Text)
 n.buytime = Date
 n.brand = txtBrand.Text
 n.value = CCur(txtvalue.Text)
 n.ccount = CInt(txtccount.Text)
 n.bargainor = txtbargainor.Text
 n.linkman = txtlinkman.Text
 If txtsaftyear.Text <> "" Then
  n.safttime = CInt(txtsaftyear.Text)
 End If
 If txtsaftmonth.Text <> "" Then
  n.safttime = n.safttime + CInt(txtsaftmonth.Text) / 12
 End If
 n.tel = txttel.Text
 n.memo = txtmemo.Text
 If cmbStoreID.Text = "" Then
  MsgBox "没有选择存放地点"
  Set n = Nothing
  Exit Sub
 End If
 n.STOREID = Trim(cmbStoreID.Text)
 n.Modify
 Set n = Nothing
End If
End Sub

Private Sub CmdQuery_Click()
If CmdQuery.Caption = "查询" Then
 Form_Init
 CmdQuery.Caption = "提交"
 Me.cmdAdd.Enabled = False
 CmdModify.Enabled = False
Else
 '让frmeselect显示所有新设备
 frmeselect.Show
 frmeselect.MHFGNewEquipment.Rows = 2
 frmeselect.MHFGShow
 CmdQuery.Caption = "查询"
 Me.cmdAdd.Enabled = True
 CmdModify.Enabled = True
End If
End Sub

Private Sub cmdstroreidquery_Click()
frmStore.Show
End Sub


Private Sub Form_Load()
frmeselect.Show
frmeselect.Visible = False
CmbConfigIDShow
CmbStoreidShow
End Sub
Private Sub Form_Init()
 Me.txtbargainor.Text = ""
 Me.txtBrand.Text = ""
 Me.txtccount.Text = ""
 Me.txtvalue = ""
 Me.txtmemo.Text = ""
 Me.txtname.Text = ""
 Me.txtsaftmonth.Text = ""
 Me.txtsaftyear.Text = ""
 Me.txtlinkman.Text = ""
 Me.txttel.Text = ""
 Me.CmbConfigID = ""
 Me.cmbStoreID = ""
End Sub


Private Sub Form_Paint()
frmeselect.Top = Me.Top
frmeselect.Left = Me.Left + Me.Width
End Sub

Private Sub Form_Unload(Cancel As Integer)
Unload frmeselect
End Sub


⌨️ 快捷键说明

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