📄 renshiguanli.vb
字号:
Me.DateTimePicker3.TabIndex = 10
'
'DateTimePicker2
'
Me.DateTimePicker2.Location = New System.Drawing.Point(112, 112)
Me.DateTimePicker2.Name = "DateTimePicker2"
Me.DateTimePicker2.Size = New System.Drawing.Size(112, 21)
Me.DateTimePicker2.TabIndex = 9
'
'Button6
'
Me.Button6.BackColor = System.Drawing.Color.LightCyan
Me.Button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button6.Location = New System.Drawing.Point(280, 192)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(56, 24)
Me.Button6.TabIndex = 8
Me.Button6.Text = "删除"
'
'Button5
'
Me.Button5.BackColor = System.Drawing.Color.LightCyan
Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button5.Location = New System.Drawing.Point(280, 256)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(56, 24)
Me.Button5.TabIndex = 7
Me.Button5.Text = "修改"
'
'Button3
'
Me.Button3.BackColor = System.Drawing.Color.LightCyan
Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button3.Location = New System.Drawing.Point(280, 136)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(56, 24)
Me.Button3.TabIndex = 6
Me.Button3.Text = "添加"
'
'Button1
'
Me.Button1.BackColor = System.Drawing.Color.LightCyan
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.Location = New System.Drawing.Point(280, 72)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(56, 24)
Me.Button1.TabIndex = 5
Me.Button1.Text = "查询"
'
'Label11
'
Me.Label11.BackColor = System.Drawing.Color.Transparent
Me.Label11.Location = New System.Drawing.Point(16, 272)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(80, 24)
Me.Label11.TabIndex = 4
Me.Label11.Text = "去向单位"
'
'Label10
'
Me.Label10.BackColor = System.Drawing.Color.Transparent
Me.Label10.Location = New System.Drawing.Point(16, 160)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(80, 24)
Me.Label10.TabIndex = 3
Me.Label10.Text = "来自单位"
'
'Label9
'
Me.Label9.BackColor = System.Drawing.Color.Transparent
Me.Label9.Location = New System.Drawing.Point(16, 208)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(80, 24)
Me.Label9.TabIndex = 2
Me.Label9.Text = "离开单位时间"
'
'Label8
'
Me.Label8.BackColor = System.Drawing.Color.Transparent
Me.Label8.Location = New System.Drawing.Point(16, 112)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(72, 24)
Me.Label8.TabIndex = 1
Me.Label8.Text = "到单位时间"
'
'Label5
'
Me.Label5.BackColor = System.Drawing.Color.Transparent
Me.Label5.Location = New System.Drawing.Point(16, 64)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(72, 24)
Me.Label5.TabIndex = 0
Me.Label5.Text = "员工编号"
'
'renshiguanli
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(384, 357)
Me.Controls.Add(Me.TabControl1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "renshiguanli"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "人事管理"
Me.TabControl1.ResumeLayout(False)
Me.TabPage1.ResumeLayout(False)
Me.TabPage2.ResumeLayout(False)
Me.TabPage3.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox1.Text = "" Or (Me.RadioButton1.Checked = False And Me.RadioButton2.Checked = False) Or Me.RichTextBox1.Text = "" Then
MsgBox("请信息未填全")
Exit Sub
End If
Dim sql As String
sql = "select * from useinfo where 员工编号='" & TextBox1.Text & "'"
If execsql(sql, "useinfo") Then
Dim i As Integer
For i = 0 To mytable.Rows.Count - 1
If Trim(TextBox1.Text) = Trim(mytable.Rows(i).Item(0)) Then
TextBox2.Text = mytable.Rows(i).Item(1)
Exit For
End If
Next
myds.Clear()
mycon.Close()
Dim sqlst As String
sqlst = "select * from jiangcheng "
execsql(sqlst, "jiangcheng")
Dim myrow1 As DataRow
myrow1 = myds.Tables("jiangcheng").NewRow
myrow1.Item(0) = Me.TextBox1.Text
myrow1.Item(1) = TextBox2.Text
If Me.RadioButton1.Checked = True Then
myrow1.Item(2) = Me.RadioButton1.Text
Else
If Me.RadioButton2.Checked = True Then
myrow1.Item(2) = Me.RadioButton2.Text
End If
End If
myrow1.Item(3) = Me.RichTextBox1.Text
myrow1.Item(4) = Me.DateTimePicker1.Text
myds.Tables("jiangcheng").Rows.Add(myrow1)
mycmb = New SqlCommandBuilder(mydad)
mydad.Update(myds, "jiangcheng")
myds.Clear()
mycon.Close()
MsgBox("添加成功")
Me.TextBox1.Clear()
Me.TextBox2.Clear()
Me.RadioButton1.Checked = False
Me.RadioButton2.Checked = False
Me.DateTimePicker1.Text = ""
Me.RichTextBox1.Clear()
Else
MsgBox("员工编号不存在,请重新输入")
TextBox1.Clear()
Me.RadioButton2.Checked = False
Me.RadioButton1.Checked = False
Me.DateTimePicker1.Text = ""
Me.RichTextBox1.Text = ""
End If
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sql As String
sql = "select * from useinfo where 员工编号='" & Trim(TextBox3.Text) & "'"
If execsql(sql, "useinfo") Then
Dim i As Integer
For i = 0 To mytable.Rows.Count - 1
If Trim(TextBox3.Text) = Trim(mytable.Rows(i).Item(0)) Then
Exit For
End If
Next
myds.Clear()
mycon.Close()
Dim sqlst As String
sqlst = "select * from diaodong "
If execsql(sqlst, "diaodong") Then
Dim i1 As Integer
For i1 = 0 To mytable.Rows.Count - 1
If Trim(TextBox3.Text) = Trim(mytable.Rows(i1).Item(0)) Then
Me.DateTimePicker2.Text = mytable.Rows(i1).Item(1)
Me.TextBox4.Text = mytable.Rows(i1).Item(2)
Me.DateTimePicker3.Text = mytable.Rows(i1).Item(3)
Me.TextBox5.Text = mytable.Rows(i1).Item(4)
Me.TextBox3.Enabled = False
If MsgBox("查询成功,是否继续查询", MsgBoxStyle.OKCancel) = MsgBoxResult.OK Then
TextBox3.Enabled = True
TextBox3.Clear()
TextBox4.Text = ""
TextBox5.Text = ""
Me.DateTimePicker2.Text = ""
Me.DateTimePicker3.Text = ""
End If
Exit Sub
End If
Next
MsgBox("无信息")
TextBox3.Clear()
End If
Else
MsgBox("员工编号不存在,请重新输入")
TextBox3.Clear()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox3.Enabled = True
If TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or Me.DateTimePicker2.Text = "" Or Me.DateTimePicker3.Text = "" Then
MsgBox("信息未填全")
Exit Sub
End If
Dim sql As String
sql = "select * from useinfo where 员工编号='" & Trim(TextBox3.Text) & "'"
If execsql(sql, "useinfo") Then
Dim i As Integer
For i = 0 To mytable.Rows.Count - 1
If Trim(TextBox3.Text) = Trim(mytable.Rows(i).Item(0)) Then
Exit For
End If
Next
myds.Clear()
mycon.Close()
Dim sqlst1 As String
sqlst1 = "select * from diaodong "
execsql(sqlst1, "diaodong")
Dim j As Integer
For j = 0 To myds.Tables("diaodong").Rows.Count - 1
If Trim(TextBox3.Text) = Trim(myds.Tables("diaodong").Rows(j).Item(0)) Then
MsgBox("调动信息已有")
Me.TextBox3.Clear()
Me.TextBox4.Clear()
Me.TextBox5.Text = ""
Me.DateTimePicker2.Text = ""
Me.DateTimePicker3.Text = ""
Exit Sub
End If
Next
myds.Clear()
mycon.Close()
Dim sqlst2 As String
sqlst2 = "select * from diaodong "
Dim myrow1 As DataRow
myrow1 = myds.Tables("diaodong").NewRow
myrow1.Item(0) = Me.TextBox3.Text
myrow1.Item(1) = Me.DateTimePicker2.Text
myrow1.Item(2) = Me.TextBox4.Text
myrow1.Item(3) = Me.DateTimePicker3.Text
myrow1.Item(4) = Me.TextBox5.Text
myds.Tables("diaodong").Rows.Add(myrow1)
mycmb = New SqlCommandBuilder(mydad)
mydad.Update(myds, "diaodong")
myds.Clear()
mycon.Close()
MsgBox("添加成功")
Me.TextBox3.Clear()
Me.TextBox4.Clear()
Me.TextBox5.Text = ""
Me.DateTimePicker2.Text = ""
Me.DateTimePicker3.Text = ""
Else
MsgBox("员工编号不存在,请重新输入")
TextBox3.Clear()
TextBox4.Text = ""
TextBox5.Text = ""
Me.DateTimePicker2.Text = ""
Me.DateTimePicker3.Text = ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -