Ejemplo n.º 1
0
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         DailyAttendanceDetailsInfo infoDailyAttendanceDetails = new DailyAttendanceDetailsInfo();
         DailyAttendanceDetailsSP spDailyAttendanceDetails = new DailyAttendanceDetailsSP();
         DailyAttendanceMasterInfo infoDailyAttendanceMaster = new DailyAttendanceMasterInfo();
         DailyAttendanceMasterSP spDailyAttendanceMaster = new DailyAttendanceMasterSP();
         string strDate = txtCompanyCurrentdate.Text;
         if (spDailyAttendanceMaster.DailyAttendanceMasterMasterIdSearch(strDate))
         {
             DataTable dtblAttendance = new DataTable();
             infoDailyAttendanceMaster.Date = Convert.ToDateTime(txtCompanyCurrentdate.Text.ToString());
             dtblAttendance = spDailyAttendanceDetails.DailyAttendanceDetailsSearchGridFill(txtCompanyCurrentdate.Text.ToString());
             dgvAttendance.DataSource = dtblAttendance;
             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
         {
             DataTable dtblAttendance = new DataTable();
             dtblAttendance = spDailyAttendanceDetails.DailyAttendanceDetailsSearchGridFill(txtCompanyCurrentdate.Text.ToString());
             dgvAttendance.DataSource = dtblAttendance;
             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);
     }
 }
 /// <summary>
 /// Function to Update values in DailyAttendanceDetails Table
 /// </summary>
 /// <param name="dailyattendancedetailsinfo"></param>
 public void DailyAttendanceDetailsEdit(DailyAttendanceDetailsInfo dailyattendancedetailsinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("DailyAttendanceDetailsEdit", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@dailyAttendanceDetailsId", SqlDbType.Decimal);
         sprmparam.Value = dailyattendancedetailsinfo.DailyAttendanceDetailsId;
         sprmparam = sccmd.Parameters.Add("@dailyAttendanceMasterId", SqlDbType.Decimal);
         sprmparam.Value = dailyattendancedetailsinfo.DailyAttendanceMasterId;
         sprmparam = sccmd.Parameters.Add("@employeeId", SqlDbType.Decimal);
         sprmparam.Value = dailyattendancedetailsinfo.EmployeeId;
         sprmparam = sccmd.Parameters.Add("@status", SqlDbType.VarChar);
         sprmparam.Value = dailyattendancedetailsinfo.Status;
         sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = dailyattendancedetailsinfo.Narration;
         sprmparam = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam.Value = dailyattendancedetailsinfo.ExtraDate;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = dailyattendancedetailsinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = dailyattendancedetailsinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Function to Daily Attendance Details Edit Using MasterId
 /// </summary>
 /// <param name="dailyattendancedetailsinfo"></param>
 public void DailyAttendanceDetailsEditUsingMasterId(DailyAttendanceDetailsInfo dailyattendancedetailsinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("DailyAttendanceDetailsEditUsingMasterId", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam       = sccmd.Parameters.Add("@dailyAttendanceDetailsId", SqlDbType.Decimal);
         sprmparam.Value = dailyattendancedetailsinfo.DailyAttendanceDetailsId;
         sprmparam       = sccmd.Parameters.Add("@dailyAttendanceMasterId", SqlDbType.Decimal);
         sprmparam.Value = dailyattendancedetailsinfo.DailyAttendanceMasterId;
         sprmparam       = sccmd.Parameters.Add("@employeeId", SqlDbType.Decimal);
         sprmparam.Value = dailyattendancedetailsinfo.EmployeeId;
         sprmparam       = sccmd.Parameters.Add("@status", SqlDbType.VarChar);
         sprmparam.Value = dailyattendancedetailsinfo.Status;
         sprmparam       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = dailyattendancedetailsinfo.Narration;
         sprmparam       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = dailyattendancedetailsinfo.Extra1;
         sprmparam       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = dailyattendancedetailsinfo.Extra2;
         int ina = sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
Ejemplo n.º 4
0
        //Function to edit
        public void EditFunction()
        {
            try
            {

                decimal decResult = HolidaySettings();
                if (decResult != 1)
                {
                    DailyAttendanceDetailsInfo infoDailyAttendanceDetails = new DailyAttendanceDetailsInfo();
                    DailyAttendanceDetailsSP spDailyAttendanceDetails = new DailyAttendanceDetailsSP();
                    DailyAttendanceMasterInfo infoDailyAttendanceMaster = new DailyAttendanceMasterInfo();
                    DailyAttendanceMasterSP spDailyAttendanceMaster = new DailyAttendanceMasterSP();
                    infoDailyAttendanceMaster.Date = DateTime.Parse(txtCompanyCurrentdate.Text.ToString());
                    infoDailyAttendanceMaster.Narration = txtNarrationInMaster.Text.Trim();
                    infoDailyAttendanceMaster.Extra1 = string.Empty;
                    infoDailyAttendanceMaster.Extra2 = string.Empty;
                    int inrowcount = dgvAttendance.RowCount;
                    for (int i = 0; i <= inrowcount - 1; i++)
                    {
                        if (dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value.ToString() != "")
                        {
                            decMasterIdForEdit = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value.ToString());   //storing Dailymasterid
                        }
                    }
                    infoDailyAttendanceMaster.DailyAttendanceMasterId = decMasterIdForEdit;
                    spDailyAttendanceMaster.DailyAttendanceEditMaster(infoDailyAttendanceMaster);
                    infoDailyAttendanceDetails.DailyAttendanceMasterId = decMasterIdForEdit;
                    for (int i = 0; i <= inrowcount - 1; i++)
                    {
                        if (dgvAttendance.Rows[i].Cells["dgvtxtDailyAttendanceDetailsId"].Value.ToString() != "")
                        {
                            // for updation of saved employees
                            if (dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.EmployeeId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString());
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvtxtDailyAttendanceDetailsId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtDailyAttendanceDetailsId"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.DailyAttendanceDetailsId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtDailyAttendanceDetailsId"].Value.ToString());
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.DailyAttendanceMasterId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value.ToString());
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value != null
                           && dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.Status = dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString();
                            }
                            else
                            {
                                infoDailyAttendanceDetails.Status = "Present";
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value != null &&
                            dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.Narration = dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString();
                            }
                            else
                            {
                                infoDailyAttendanceDetails.Narration = "";
                            }
                            infoDailyAttendanceDetails.Extra1 = string.Empty;
                            infoDailyAttendanceDetails.Extra2 = string.Empty;
                            spDailyAttendanceDetails.DailyAttendanceDetailsEditUsingMasterId(infoDailyAttendanceDetails);
                        }
                        else
                        {
                            // for new employees to add
                            if (dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.EmployeeId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString());
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value != null
                                && dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.Status = dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString();
                            }
                            else
                            {
                                infoDailyAttendanceDetails.Status = "Present";
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value != null &&
                           dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.Narration = dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString();
                            }
                            else
                            {
                                infoDailyAttendanceDetails.Narration = "";
                            }
                            infoDailyAttendanceDetails.Extra1 = string.Empty;
                            infoDailyAttendanceDetails.Extra2 = string.Empty;
                            infoDailyAttendanceDetails.DailyAttendanceMasterId = decMasterIdForEdit;
                            spDailyAttendanceDetails.DailyAttendanceDetailsAddUsingMasterId(infoDailyAttendanceDetails);
                        }
                    } //   updation of old employees & addition of new employees closes here
                    Messages.UpdatedMessage();
                    Clear();
                }
                else
                {
                    Messages.InformationMessage("Selected date is holiday");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("A3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Function to save
        /// </summary>
        public void SaveFunction()
        {
            try
            {


                decimal decResult = HolidaySettings();
                if (decResult != 1)
                {
                    DailyAttendanceDetailsInfo infoDailyAttendanceDetails = new DailyAttendanceDetailsInfo();
                    DailyAttendanceDetailsSP spDailyAttendanceDetails = new DailyAttendanceDetailsSP();
                    DailyAttendanceMasterInfo infoDailyAttendanceMaster = new DailyAttendanceMasterInfo();
                    DailyAttendanceMasterSP spDailyAttendanceMaster = new DailyAttendanceMasterSP();
                    infoDailyAttendanceMaster.Date = Convert.ToDateTime(txtCompanyCurrentdate.Text.ToString());
                    infoDailyAttendanceMaster.Narration = txtNarrationInMaster.Text.Trim();
                    infoDailyAttendanceMaster.Extra1 = string.Empty;
                    infoDailyAttendanceMaster.Extra2 = string.Empty;
                    int inrowcount = dgvAttendance.RowCount;
                    decMasterIdForEdit = spDailyAttendanceMaster.DailyAttendanceAddToMaster(infoDailyAttendanceMaster);  // calling @@identity
                    infoDailyAttendanceDetails.DailyAttendanceMasterId = decMasterIdForEdit;
                    for (int i = 0; i <= inrowcount - 1; i++)
                    {
                        if (dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString() != "")
                        {
                            infoDailyAttendanceDetails.EmployeeId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString());
                        }
                        if (dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value != null
                            && dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString() != "")
                        {
                            infoDailyAttendanceDetails.Status = dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString();
                        }
                        else
                        {
                            infoDailyAttendanceDetails.Status = "Present";
                        }
                        if (dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value != null &&
                       dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString() != "")
                        {
                            infoDailyAttendanceDetails.Narration = dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString();
                        }
                        else
                        {
                            infoDailyAttendanceDetails.Narration = "";
                        }
                        infoDailyAttendanceDetails.Extra1 = string.Empty;
                        infoDailyAttendanceDetails.Extra2 = string.Empty;
                        infoDailyAttendanceDetails.DailyAttendanceMasterId = decMasterIdForEdit;
                        spDailyAttendanceDetails.DailyAttendanceDetailsAddUsingMasterId(infoDailyAttendanceDetails);
                    }
                    Messages.SavedMessage();
                    Clear();

                }
                else
                {
                    Messages.InformationMessage("Selected date is holiday");

                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("A2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 6
0
        //Function to edit
        public void EditFunction()
        {
            try
            {
                decimal decResult = HolidaySettings();
                if (decResult != 1)
                {
                    DailyAttendanceDetailsInfo infoDailyAttendanceDetails = new DailyAttendanceDetailsInfo();
                    DailyAttendanceDetailsSP   spDailyAttendanceDetails   = new DailyAttendanceDetailsSP();
                    DailyAttendanceMasterInfo  infoDailyAttendanceMaster  = new DailyAttendanceMasterInfo();
                    DailyAttendanceMasterSP    spDailyAttendanceMaster    = new DailyAttendanceMasterSP();
                    infoDailyAttendanceMaster.Date      = DateTime.Parse(txtCompanyCurrentdate.Text.ToString());
                    infoDailyAttendanceMaster.Narration = txtNarrationInMaster.Text.Trim();
                    infoDailyAttendanceMaster.Extra1    = string.Empty;
                    infoDailyAttendanceMaster.Extra2    = string.Empty;
                    int inrowcount = dgvAttendance.RowCount;
                    for (int i = 0; i <= inrowcount - 1; i++)
                    {
                        if (dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value.ToString() != "")
                        {
                            decMasterIdForEdit = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value.ToString());   //storing Dailymasterid
                        }
                    }
                    infoDailyAttendanceMaster.DailyAttendanceMasterId = decMasterIdForEdit;
                    spDailyAttendanceMaster.DailyAttendanceEditMaster(infoDailyAttendanceMaster);
                    infoDailyAttendanceDetails.DailyAttendanceMasterId = decMasterIdForEdit;
                    for (int i = 0; i <= inrowcount - 1; i++)
                    {
                        if (dgvAttendance.Rows[i].Cells["dgvtxtDailyAttendanceDetailsId"].Value.ToString() != "")
                        {
                            // for updation of saved employees
                            if (dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.EmployeeId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString());
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvtxtDailyAttendanceDetailsId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtDailyAttendanceDetailsId"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.DailyAttendanceDetailsId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtDailyAttendanceDetailsId"].Value.ToString());
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.DailyAttendanceMasterId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtdailyAttendanceMasterId"].Value.ToString());
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value != null &&
                                dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.Status = dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString();
                            }
                            else
                            {
                                infoDailyAttendanceDetails.Status = "Present";
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value != null &&
                                dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.Narration = dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString();
                            }
                            else
                            {
                                infoDailyAttendanceDetails.Narration = "";
                            }
                            infoDailyAttendanceDetails.Extra1 = string.Empty;
                            infoDailyAttendanceDetails.Extra2 = string.Empty;
                            spDailyAttendanceDetails.DailyAttendanceDetailsEditUsingMasterId(infoDailyAttendanceDetails);
                        }
                        else
                        {
                            // for new employees to add
                            if (dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.EmployeeId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString());
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value != null &&
                                dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.Status = dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString();
                            }
                            else
                            {
                                infoDailyAttendanceDetails.Status = "Present";
                            }
                            if (dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value != null &&
                                dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString() != "")
                            {
                                infoDailyAttendanceDetails.Narration = dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString();
                            }
                            else
                            {
                                infoDailyAttendanceDetails.Narration = "";
                            }
                            infoDailyAttendanceDetails.Extra1 = string.Empty;
                            infoDailyAttendanceDetails.Extra2 = string.Empty;
                            infoDailyAttendanceDetails.DailyAttendanceMasterId = decMasterIdForEdit;
                            spDailyAttendanceDetails.DailyAttendanceDetailsAddUsingMasterId(infoDailyAttendanceDetails);
                        }
                    } //   updation of old employees & addition of new employees closes here
                    Messages.UpdatedMessage();
                    Clear();
                }
                else
                {
                    Messages.InformationMessage("Selected date is holiday");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("A3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Function to save
        /// </summary>
        public void SaveFunction()
        {
            try
            {
                decimal decResult = HolidaySettings();
                if (decResult != 1)
                {
                    DailyAttendanceDetailsInfo infoDailyAttendanceDetails = new DailyAttendanceDetailsInfo();
                    DailyAttendanceDetailsSP   spDailyAttendanceDetails   = new DailyAttendanceDetailsSP();
                    DailyAttendanceMasterInfo  infoDailyAttendanceMaster  = new DailyAttendanceMasterInfo();
                    DailyAttendanceMasterSP    spDailyAttendanceMaster    = new DailyAttendanceMasterSP();
                    infoDailyAttendanceMaster.Date      = Convert.ToDateTime(txtCompanyCurrentdate.Text.ToString());
                    infoDailyAttendanceMaster.Narration = txtNarrationInMaster.Text.Trim();
                    infoDailyAttendanceMaster.Extra1    = string.Empty;
                    infoDailyAttendanceMaster.Extra2    = string.Empty;
                    int inrowcount = dgvAttendance.RowCount;
                    decMasterIdForEdit = spDailyAttendanceMaster.DailyAttendanceAddToMaster(infoDailyAttendanceMaster);  // calling @@identity
                    infoDailyAttendanceDetails.DailyAttendanceMasterId = decMasterIdForEdit;
                    for (int i = 0; i <= inrowcount - 1; i++)
                    {
                        if (dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value != null && dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString() != "")
                        {
                            infoDailyAttendanceDetails.EmployeeId = Convert.ToDecimal(dgvAttendance.Rows[i].Cells["dgvtxtColumnEmployeeId"].Value.ToString());
                        }
                        if (dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value != null &&
                            dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString() != "")
                        {
                            infoDailyAttendanceDetails.Status = dgvAttendance.Rows[i].Cells["dgvcmbcolumnStatus"].Value.ToString();
                        }
                        else
                        {
                            infoDailyAttendanceDetails.Status = "Present";
                        }
                        if (dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value != null &&
                            dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString() != "")
                        {
                            infoDailyAttendanceDetails.Narration = dgvAttendance.Rows[i].Cells["dgvtxtColumnnarration"].Value.ToString();
                        }
                        else
                        {
                            infoDailyAttendanceDetails.Narration = "";
                        }
                        infoDailyAttendanceDetails.Extra1 = string.Empty;
                        infoDailyAttendanceDetails.Extra2 = string.Empty;
                        infoDailyAttendanceDetails.DailyAttendanceMasterId = decMasterIdForEdit;
                        spDailyAttendanceDetails.DailyAttendanceDetailsAddUsingMasterId(infoDailyAttendanceDetails);
                    }
                    Messages.SavedMessage();
                    Clear();
                }
                else
                {
                    Messages.InformationMessage("Selected date is holiday");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("A2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// Function to get particular values from DailyAttendanceDetails Table based on the parameter
 /// </summary>
 /// <param name="dailyAttendanceDetailsId"></param>
 /// <returns></returns>
 public DailyAttendanceDetailsInfo DailyAttendanceDetailsView(decimal dailyAttendanceDetailsId)
 {
     DailyAttendanceDetailsInfo dailyattendancedetailsinfo = new DailyAttendanceDetailsInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("DailyAttendanceDetailsView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@dailyAttendanceDetailsId", SqlDbType.Decimal);
         sprmparam.Value = dailyAttendanceDetailsId;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             dailyattendancedetailsinfo.DailyAttendanceDetailsId = decimal.Parse(sdrreader[0].ToString());
             dailyattendancedetailsinfo.DailyAttendanceMasterId = decimal.Parse(sdrreader[1].ToString());
             dailyattendancedetailsinfo.EmployeeId = decimal.Parse(sdrreader[2].ToString());
             dailyattendancedetailsinfo.Status = sdrreader[3].ToString();
             dailyattendancedetailsinfo.Narration = sdrreader[4].ToString();
             dailyattendancedetailsinfo.ExtraDate = DateTime.Parse(sdrreader[5].ToString());
             dailyattendancedetailsinfo.Extra1 = sdrreader[6].ToString();
             dailyattendancedetailsinfo.Extra2 = sdrreader[7].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return dailyattendancedetailsinfo;
 }