/// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         DailyAttendanceDetailsInfo infoDailyAttendanceDetails = new DailyAttendanceDetailsInfo();
         AttendanceBll BllAttandance = new AttendanceBll();
         DailyAttendanceMasterInfo infoDailyAttendanceMaster = new DailyAttendanceMasterInfo();
         AttendanceBll BllAttandanceMaster = new AttendanceBll();
         string strDate = txtCompanyCurrentdate.Text;
         if (BllAttandanceMaster.DailyAttendanceMasterMasterIdSearch(strDate))
         {
             List<DataTable> listObj = new List<DataTable>();
             infoDailyAttendanceMaster.Date = Convert.ToDateTime(txtCompanyCurrentdate.Text.ToString());
             listObj = BllAttandance.DailyAttendanceDetailsSearchGridFill(txtCompanyCurrentdate.Text.ToString());
             dgvAttendance.DataSource = listObj[0];
             btnDelete.Enabled = true;
             btnSave.Text = "Update";
             int inRowCount = dgvAttendance.RowCount;
             string strMasterNarration = string.Empty;
             for (int i = 0; i < inRowCount; i++)
             {
                 if (dgvAttendance.Rows[i].Cells["MasterNarration"].Value.ToString() != "")
                 {
                     strMasterNarration = dgvAttendance.Rows[i].Cells["MasterNarration"].Value.ToString();
                 }
             }
             txtNarrationInMaster.Text = strMasterNarration;
         }
         else
         {
             List<DataTable> listObj1 = new List<DataTable>();
             listObj1 = BllAttandance.DailyAttendanceDetailsSearchGridFill(txtCompanyCurrentdate.Text.ToString());
             dgvAttendance.DataSource = listObj1[0];
             btnDelete.Enabled = false;
             btnSave.Text = "Save";
             int inRowCount = dgvAttendance.RowCount;
             string strMasterNarration = string.Empty;
             for (int i = 0; i < inRowCount; i++)
             {
                 if (dgvAttendance.Rows[i].Cells["MasterNarration"].Value.ToString() != null)
                 {
                     strMasterNarration = dgvAttendance.Rows[i].Cells["MasterNarration"].Value.ToString();
                 }
             }
             txtNarrationInMaster.Text = strMasterNarration;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("A1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }