private void grdAttendanceDetail_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     try
     {
         if (roleId != 3)
         {
             if (grdAttendanceDetail.CurrentCell.RowIndex < Convert.ToInt32(tbxCount.Text))
             {
                 DataGridViewRow dr                   = grdAttendanceDetail.SelectedRows[0];
                 int             recordid             = Convert.ToInt32(dr.Cells["AttendanceDetailId"].Value.ToString());
                 AttendanceForm  attendanceDetailForm = new AttendanceForm(recordid);
                 attendanceDetailForm.ShowDialog();
             }
             FillGrid(selectedRecordId);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void btnMark_Click(object sender, EventArgs e)
        {
            AttendanceForm attendance = new AttendanceForm();

            attendance.Show();
        }