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

📄 frmsalesman.frm

📁 ERP工程管理子系统,用于ERP编程者参考.
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmSalesman 
   Caption         =   "ERP-工程管理子系统"
   ClientHeight    =   5490
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7875
   Icon            =   "FrmSalesman.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   5490
   ScaleWidth      =   7875
   StartUpPosition =   2  '屏幕中心
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   3495
      Left            =   240
      TabIndex        =   1
      Top             =   1080
      Width           =   7335
      _ExtentX        =   12938
      _ExtentY        =   6165
      _Version        =   393216
      Enabled         =   -1  'True
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   3
      BeginProperty Column00 
         DataField       =   "SalesmanID"
         Caption         =   "销售员代号"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   "SalesmanName"
         Caption         =   "销售员姓名"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "Department"
         Caption         =   "所属部门"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   2264.882
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   2234.835
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   2505.26
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   120
      Top             =   5040
      Visible         =   0   'False
      Width           =   2055
      _ExtentX        =   3625
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Image Image4 
      Height          =   300
      Left            =   5520
      Picture         =   "FrmSalesman.frx":0CCA
      Top             =   4800
      Width           =   300
   End
   Begin VB.Label LblBack 
      BackStyle       =   0  'Transparent
      Caption         =   "返回"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   6120
      MouseIcon       =   "FrmSalesman.frx":10E6
      MousePointer    =   99  'Custom
      TabIndex        =   5
      Top             =   4800
      Width           =   615
   End
   Begin VB.Image Image3 
      Height          =   300
      Left            =   4080
      Picture         =   "FrmSalesman.frx":13F0
      Top             =   4800
      Width           =   300
   End
   Begin VB.Label LblDelete 
      BackStyle       =   0  'Transparent
      Caption         =   "删除"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   4680
      MouseIcon       =   "FrmSalesman.frx":180C
      MousePointer    =   99  'Custom
      TabIndex        =   4
      Top             =   4800
      Width           =   615
   End
   Begin VB.Image Image2 
      Height          =   300
      Left            =   2640
      Picture         =   "FrmSalesman.frx":1B16
      Top             =   4800
      Width           =   300
   End
   Begin VB.Label LblModify 
      BackStyle       =   0  'Transparent
      Caption         =   "修改"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      MouseIcon       =   "FrmSalesman.frx":1F32
      MousePointer    =   99  'Custom
      TabIndex        =   3
      Top             =   4800
      Width           =   615
   End
   Begin VB.Image Image1 
      Height          =   300
      Left            =   1080
      Picture         =   "FrmSalesman.frx":223C
      Top             =   4800
      Width           =   300
   End
   Begin VB.Label LblAdd 
      BackStyle       =   0  'Transparent
      Caption         =   "添加"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1680
      MouseIcon       =   "FrmSalesman.frx":2658
      MousePointer    =   99  'Custom
      TabIndex        =   2
      Top             =   4800
      Width           =   615
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "销售员信息"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2880
      TabIndex        =   0
      Top             =   360
      Width           =   1935
   End
End
Attribute VB_Name = "FrmSalesman"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False






Private Sub Form_Load()
'连接字符串
Adodc1.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
'查询Users表中全部信息
Adodc1.RecordSource = "select * from Salesman"
'用DataGrid显示查询信息
Set DataGrid1.DataSource = Adodc1
'刷新窗口信息
Refresh_Salesman
End Sub



Private Sub LblAdd_Click()
FrmSalesmanEdit.Caption = "添加销售员"
'标明操作为添加而非修改
FrmSalesmanEdit.Modify = False
'显示销售员信息编辑窗口
FrmSalesmanEdit.Show 1
'刷新销售员管理界面
Refresh_Salesman
End Sub

Private Sub LblBack_Click()
Unload Me
End Sub


Private Sub LblDelete_Click()
Dim TempSalesmanID As String
'保存待删除记录的ID
  TempSalesmanID = Adodc1.Recordset.Fields(0)
'弹出删除确认对话框
  If MsgBox("是否删除" + Adodc1.Recordset.Fields(1) + "?", vbYesNo, "确认") = vbYes Then
    '调用类中Delete函数删除销售员信息
    MySalesman.Delete (TempSalesmanID)
    MsgBox "删除成功"
  End If
  '刷新销售员管理界面
Refresh_Salesman
End Sub


Private Sub LblModify_Click()

'保存待修改记录的原始ID
FrmSalesmanEdit.OriSalesmanID = Trim(Adodc1.Recordset.Fields(0))
'把待修改信息添加到编辑窗口
FrmSalesmanEdit.TxtSalesmanID = Trim(Adodc1.Recordset.Fields(0))
FrmSalesmanEdit.TxtSalesmanName = Trim(Adodc1.Recordset.Fields(1))
FrmSalesmanEdit.TxtDepartment = Trim(Adodc1.Recordset.Fields(2))

FrmSalesmanEdit.TxtSalesmanID.Enabled = False
FrmSalesmanEdit.Caption = "修改销售员信息"
'标明操作为修改操作
FrmSalesmanEdit.Modify = True
'显示销售员编辑窗口
FrmSalesmanEdit.Show 1
'刷新销售员管理界面
Refresh_Salesman
End Sub


Private Sub Refresh_Salesman()
'刷新Adodc,重新获取当前数据库表信息
  Adodc1.Refresh
  '如果能查不到记录
 If Adodc1.Recordset.RecordCount = 0 Then
  '修改和删除不可用
 LblModify.Enabled = False
 LblDelete.Enabled = False
 Else
  '如果能查到记录,修改和删除可用
 LblModify.Enabled = True
 LblDelete.Enabled = True
 End If
End Sub

⌨️ 快捷键说明

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