📄 frmmemberedit.frm
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmMemberEdit
Caption = "编辑项目成员信息"
ClientHeight = 2805
ClientLeft = 60
ClientTop = 345
ClientWidth = 6960
LinkTopic = "Form1"
ScaleHeight = 2805
ScaleWidth = 6960
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox ComboStatus
Height = 300
Left = 4800
Style = 2 'Dropdown List
TabIndex = 11
Top = 1335
Width = 1695
End
Begin VB.TextBox txtDate
Height = 330
Left = 1440
TabIndex = 8
Top = 1320
Width = 1695
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Height = 495
Left = 1560
TabIndex = 7
Top = 2040
Width = 1335
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取 消"
Height = 495
Left = 4080
TabIndex = 6
Top = 2040
Width = 1335
End
Begin VB.TextBox txtName
Enabled = 0 'False
Height = 330
Left = 1440
TabIndex = 4
Top = 240
Width = 5055
End
Begin MSDataListLib.DataCombo dco_Role
Height = 330
Left = 4800
TabIndex = 0
Top = 780
Width = 1695
_ExtentX = 2990
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin MSAdodcLib.Adodc AdoEmp
Height = 330
Left = 120
Top = 1800
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 582
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 = "AdoEmp"
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
Begin MSDataListLib.DataCombo dco_Emp
Height = 330
Left = 1440
TabIndex = 1
Top = 780
Width = 1695
_ExtentX = 2990
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin MSAdodcLib.Adodc AdoRole
Height = 330
Left = 120
Top = 2160
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 582
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 = "AdoRole"
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
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "当前状态"
Height = 180
Left = 3720
TabIndex = 10
Top = 1395
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "加入日期"
Height = 180
Left = 360
TabIndex = 9
Top = 1395
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "项目名称"
Height = 180
Left = 360
TabIndex = 5
Top = 315
Width = 720
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "项目角色"
Height = 180
Left = 3720
TabIndex = 3
Top = 855
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "选择成员"
Height = 180
Left = 360
TabIndex = 2
Top = 855
Width = 720
End
End
Attribute VB_Name = "FrmMemberEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriMemId As Long '成员编号
Public OriProId As Long '项目编号
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
If Len(Trim(dco_Emp.Text)) = 0 Then
MsgBox "请选择员工"
dco_Emp.SetFocus
Exit Sub
End If
If Len(Trim(dco_Role.Text)) = 0 Then
MsgBox "请选择成员角色"
dco_Role.SetFocus
Exit Sub
End If
With MyMem
.ProId = OriProId
.EmpId = dco_Emp.BoundText()
.RoleId = dco_Role.BoundText()
.JoinDate = Date
.MStatus = Trim(ComboStatus.Text)
If Modify Then
.Update (OriMemId)
MsgBox "修改成功"
Else
.Insert
MsgBox "添加成功"
End If
End With
Unload Me
End Sub
Private Sub Form_Load()
'装入员工信息
AdoEmp.ConnectionString = Conn
AdoEmp.RecordSource = "Select * From Employees Order By EmpId"
AdoEmp.Refresh
Set dco_Emp.RowSource = AdoEmp
dco_Emp.BoundColumn = "EmpId"
dco_Emp.ListField = "EmpName"
'装入角色信息
AdoRole.ConnectionString = Conn
AdoRole.RecordSource = "Select * From Roles Order By RoleId"
AdoRole.Refresh
Set dco_Role.RowSource = AdoRole
dco_Role.BoundColumn = "RoleId"
dco_Role.ListField = "RoleName"
'设置成员当前状态
ComboStatus.AddItem "正常", 0
ComboStatus.AddItem "失效", 1
ComboStatus.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -