/// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         string strEmployeeStatus = string.Empty;
         if (rbtnAll.Checked)
         {
             strEmployeeStatus = "All";
         }
         else if (rbtnActive.Checked)
         {
             strEmployeeStatus = "Active";
         }
         else if (rbtnInActive.Checked)
         {
             strEmployeeStatus = "InActive";
         }
         if (strEmployeeStatus != string.Empty && cmbDesigantion.SelectedIndex > -1)
         {
             CreateGrid();
             AttendanceBll BllAttendanceMaster = new AttendanceBll();
             EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
             List<DataTable> listEmployee = new List<DataTable>();
             listEmployee = BllEmployeeCreation.EmployeeViewByDesignationAndStatus(cmbDesigantion.Text, strEmployeeStatus);
             if (listEmployee[0].Rows.Count > 0)
             {
                 for (int i = 0; i < listEmployee[0].Rows.Count; i++)
                 {
                     dgvMonthlyAttendance.Rows.Add();
                     dgvMonthlyAttendance.Rows[i].Cells["employeeId"].Value = listEmployee[0].Rows[i]["employeeId"].ToString();
                     dgvMonthlyAttendance.Rows[i].Cells["SlNo"].Value = i + 1;
                     dgvMonthlyAttendance.Rows[i].Cells["employeeName"].Value = listEmployee[0].Rows[i]["employeeName"].ToString();
                     dgvMonthlyAttendance.Rows[i].Cells["employeeCode"].Value = listEmployee[0].Rows[i]["employeeCode"].ToString();
                     List<DataTable> listStatus = BllAttendanceMaster.MonthlyAttendanceReportFill(dtpMonth.Value, Convert.ToDecimal(listEmployee[0].Rows[i]["employeeId"].ToString()));
                    if (listStatus[0].Rows.Count > 0)
                     {
                         for (int j = 0; j < listStatus[0].Rows.Count; j++)
                         {
                             dgvMonthlyAttendance.Rows[i].Cells[DateTime.Parse(listStatus[0].Rows[j]["date"].ToString()).Day.ToString()].Value = listStatus[0].Rows[j]["status"].ToString();
                         }
                     }
                     FindTotal(i);
                 }
             }
             CheckedChange();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MAR2 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }