Private Sub SaveTime()
'บันทึกเวลาออกทำงาน
Dim a As String = TextBoxIdEm.Text
Dim str As String = "INSERT INTO WorkTime (TimeOut) VALUES('" & Now & "') AND SELECT * FROM Working WHERE EmpId = '" + TextBoxIdEm.Text + "'"
cnn.Open()
cmd.Connection = cnn
cmd.CommandText = str
cmd.ExecuteNonQuery()
If cmd.ExecuteNonQuery = 0 Then
MessageBox.Show("บันทึกไม่สำเร็จ ", "ไม่สำเร็จ", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Else
MessageBox.Show("บันทึกสำเร็จ ", "สำเร็จ", MessageBoxButtons.OK, MessageBoxIcon.Information)
cnn.Close()
End If
End Sub
End Class