?? frmempedit.vb
字號:
Class FrmEmpEdit
Inherits System.Windows.Forms.Form
Public Modify As Boolean
Private Sub Cmd_Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cmd_Cancel.Click
FrmEmpMan.TmpOk = False
Me.Close()
End Sub
Private Sub Cmd_OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cmd_OK.Click
Dim tt As Object
Dim t As Object
Dim dd As Object
With MyEmp
.Emp_Name = Trim(txtEmp_Name.Text) '姓名
.Sex = ComboSex.Text '性別
.State = ComboState.SelectedIndex + 1 '員工狀態
.Nationality = Trim(txtNationality.Text) '民族
' If IsDate(ComboBirth1.Text) = False Then '生日
' MsgBox("請選擇正確的出生日期")
' Exit Sub
' End If
.Birth = ComboBirth.Text
.Political_Party = Trim(txtPolitical_Party.Text) '政治面貌
.Culture_Level = Trim(txtCulture_Level.Text) '文化程度
.Marital_Condition = Trim(ComboMarital.Text) '婚姻狀況
.Family_Place = Trim(txtFamily_Place.Text) '籍貫
.PcId = Trim(txtPcId.Text) '檔案電腦號
.Id_Card = Trim(txtId_Card.Text) '身份證號
.BadgeID = Trim(txtBadgeID.Text) '工作證號
.Office_phone = Trim(txtOfficePhone.Text) '辦公電話
.Home_phone = Trim(txtHomePhone.Text) '家庭電話
.Mobile = Trim(txtMobile.Text) '移動電話
.Bp = Trim(txtBp.Text) 'BP機
.Files_Keep_Org = Trim(txtFiles_Keep_Org.Text) '檔案存放地
.Residence = Trim(txtResidence.Text) '居住地址
.Hukou = Trim(txtHukou.Text) '戶口所在地
.Postcode = Trim(txtPostcode.Text) '郵政編號
.Police_Post = Trim(txtPolice_Post.Text) '戶口所在地派出所
'戶口所在地街道
.Street_Office = Trim(txtStreet_Office.Text)
'本企業工齡起始日期
' If IsDate(ComboHireDate.Text) = False Then
' MsgBox("請選擇正確的本企業工齡起始日期")
' Exit Sub
' End If
.HireDate = ComboHireDate.Text
.Working_Years = Val(txtWorking_Years.Text) '工齡
' If IsDate(ComboContractSign.Text) = False Then
' MsgBox("請選擇正確的簽訂勞動合同日期")
' Exit Sub '簽訂勞動合同日期
' End If
.Contract_Sign_Date = ComboContractSign.Text
.Position = Trim(txtPosition.Text) '崗位
.Title = Trim(txtTitle.Text) '職務
.UpperId = UpperEmp.Emp_Id '上級員工
.Base_Wage = Val(txtBaseWage.Text) '基本工資
.Base_Prize = Val(txtBasePrize.Text) '獎金基數
.Fillin_Person = Trim(txtFillin_Person.Text) '填表人
.Memo = Trim(txtMemo.Text) '備注
'填表時間
dd = Today
dd = VB6.Format(dd, "yyyy-mm-dd")
t = TimeOfDay
tt = Trim(Str(Hour(t))) & ":" & Trim(Str(Minute(t))) & ":" & Trim(Str(Second(t)))
.Fillin_Time = dd + " " + tt
.Dep_Id = CurDep.Dep_Id '部門編號
If Modify = False Then
.Insert()
Else
.Update((CurEmp.Emp_Id))
End If
End With
'設置員工信息管理窗體中的狀態標識
FrmEmpMan.TmpOk = True
Me.Close()
End Sub
' Private Sub ComboBirth_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
'將焦點設置為下一個控件,否則將反復執行此過程
' txtPolitical_Party.Focus()
'如果ComboBirth中包含日期,則將它賦值到FrmDateSel中
' If ComboBirth1.Text <> "" Then
' FrmDateSel.OriDate = ComboBirth1.Text
' Else
' FrmDateSel.OriDate = ""
' End If
'設置FrmDateSel窗體的位置
' FrmDateSel.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Me.Left) + VB6.PixelsToTwipsX(ComboBirth1.Left) + 350)
' FrmDateSel.Top = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(Me.Top) + VB6.PixelsToTwipsY(ComboBirth1.Top) + VB6.PixelsToTwipsY(ComboBirth1.Height) + 450)
' FrmDateSel.ShowDialog()
'將選擇的日期顯示到ComboBirth控件中
' ComboBirth1.Text = FrmDateSel.OriDate
' End Sub
' Private Sub ComboContractSign_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboContractSign.Enter
' txtPosition.Focus()
' If ComboContractSign.Text <> "" Then
' FrmDateSel.OriDate = ComboContractSign.Text
' Else
' FrmDateSel.OriDate = ""
' End If
' FrmDateSel.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Me.Left) + VB6.PixelsToTwipsX(ComboContractSign.Left) + 350)
' FrmDateSel.Top = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(Me.Top) + VB6.PixelsToTwipsY(ComboContractSign.Top) + VB6.PixelsToTwipsY(ComboContractSign.Height) - VB6.PixelsToTwipsY(FrmDateSel.Height))
' FrmDateSel.ShowDialog()
' ComboContractSign.Text = FrmDateSel.OriDate
'End Sub
'Private Sub ComboHireDate_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
' txtWorking_Years.Focus()
' If ComboHireDate.Text <> "" Then
' FrmDateSel.OriDate = ComboHireDate.Text
' Else
' FrmDateSel.OriDate = ""
' End If
' FrmDateSel.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Me.Left) + VB6.PixelsToTwipsX(ComboHireDate.Left))
' FrmDateSel.Top = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(Me.Top) + VB6.PixelsToTwipsY(ComboHireDate.Top) + VB6.PixelsToTwipsY(ComboHireDate.Height) - VB6.PixelsToTwipsY(FrmDateSel.Height))
'
' FrmDateSel.ShowDialog()
' ComboHireDate.Text = FrmDateSel.OriDate
' End Sub
Private Sub ComboUpper_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboUpper.Enter
Dim TmpId As Short
'將焦點設置為下一個控件,否則將反復執行此過程
txtBaseWage.Focus()
'保存CurDep
TmpId = CurDep.Dep_Id
'設置FrmEmpSel窗體的位置
FrmEmpSel.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Me.Left) + VB6.PixelsToTwipsX(ComboUpper.Left) + 350 - VB6.PixelsToTwipsX(FrmEmpSel.Width))
FrmEmpSel.Top = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(Me.Top) + VB6.PixelsToTwipsY(ComboUpper.Top) - VB6.PixelsToTwipsY(FrmEmpSel.Height) + 450)
FrmEmpSel.ShowDialog()
'將選擇的員工姓名顯示到ComboUpper控件中
ComboUpper.Text = UpperEmp.Emp_Name
'恢復CurDep
CurDep.Dep_Id = TmpId
CurDep.GetInfo((CurDep.Dep_Id))
End Sub
Private Sub FrmEmpEdit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim txtTouristExp As Object
Dim txtPerformance As Object
Dim txtPosition_Wage As Object
Dim txtBase_Wage As Object
Dim txtTouristID As Object
If Modify = False Then
txtEmp_Name.Text = ""
ComboSex.SelectedIndex = 0
ComboState.SelectedIndex = 0
txtNationality.Text = ""
ComboBirth.Text = ""
txtPolitical_Party.Text = ""
txtFamily_Place.Text = ""
txtPcId.Text = ""
txtId_Card.Text = ""
txtBadgeID.Text = ""
txtTouristID = ""
txtOfficePhone.Text = ""
txtHomePhone.Text = ""
txtMobile.Text = ""
txtBp.Text = ""
txtFiles_Keep_Org.Text = ""
txtResidence.Text = ""
txtHukou.Text = ""
txtPostcode.Text = ""
txtPolice_Post.Text = ""
txtStreet_Office.Text = ""
ComboHireDate.Text = ""
txtWorking_Years.Text = ""
ComboContractSign.Text = ""
txtPosition.Text = ""
txtTitle.Text = ""
ComboUpper.Text = ""
txtBase_Wage = ""
txtPosition_Wage = ""
txtFillin_Person.Text = ""
txtPerformance = ""
txtTouristExp = ""
txtMemo.Text = ""
Else
With CurEmp
txtEmp_Name.Text = .Emp_Name '姓名
If InCombo(.Sex, ComboSex) = True Then
ComboSex.Text = .Sex '性別
End If
txtNationality.Text = .Nationality
ComboBirth.Text = .Birth
txtPolitical_Party.Text = .Political_Party
txtFamily_Place.Text = .Family_Place
If InCombo(.Marital_Condition, ComboMarital) = True Then
ComboMarital.Text = .Marital_Condition
End If
txtCulture_Level.Text = .Culture_Level
txtPcId.Text = .PcId
txtId_Card.Text = .Id_Card
txtBadgeID.Text = .BadgeID
txtOfficePhone.Text = .Office_phone
txtHomePhone.Text = .Home_phone
txtMobile.Text = .Mobile
txtBp.Text = .Bp
txtFiles_Keep_Org.Text = .Files_Keep_Org
txtResidence.Text = .Residence
txtHukou.Text = .Hukou
txtPostcode.Text = .Postcode
txtPolice_Post.Text = .Police_Post
txtStreet_Office.Text = .Street_Office
ComboHireDate.Text = .HireDate
txtWorking_Years.Text = CStr(.Working_Years)
ComboContractSign.Text = .Contract_Sign_Date
txtPosition.Text = .Position
txtTitle.Text = .Title
ComboUpper.Text = MyEmp.GetName(.UpperId)
txtBaseWage.Text = CStr(.Base_Wage)
txtBasePrize.Text = CStr(.Base_Prize)
txtFillin_Person.Text = .Fillin_Person
txtMemo.Text = .Memo
End With
End If
End Sub
Private Sub txtBadgeID_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtBadgeID.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
EnterTAB((KeyAscii))
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -