private void Attendance_Delete_Click(object sender, RoutedEventArgs e) { try { int AttendaceId = int.Parse(txtAId.Text); if (attendanceBLL.DeleteAttendanceBLL(AttendaceId, LoginEntity.UserID)) { MessageBox.Show("Attendance Deleted Successfully!!"); LoadGrid(); } else { MessageBox.Show("Attendance Is Already Approved or Rejected. Cannot Delete!!!"); } } catch (Exception ex) { MessageBox.Show("Attendance not deleted. Error is: " + ex); } }