コード例 #1
0
        private void Attendance_Update_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                attendanceEntity.AttendanceID   = int.Parse(txtAId.Text);
                attendanceEntity.EmployeeID     = int.Parse(txtEmpId.Text);
                attendanceEntity.AttendanceType = cmbAType.Text;
                attendanceEntity.AttendanceDate = txtDate.SelectedDate.Value;
                attendanceEntity.InTime         = txtInTime.Text;
                attendanceEntity.OutTime        = txtOutTime.Text;

                if (attendanceBLL.UpdateAttendanceBLL(attendanceEntity) == true)
                {
                    MessageBox.Show("Attendace Updated Succesfully!!");
                    LoadGrid();
                }
                else
                {
                    MessageBox.Show("Attendance Is Already Approved or Rejected. Cannot Update!!!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            LoadGrid();
        }