/// <summary>
 /// Function to insert values to MonthlySalaryDetails Table with monthlySalaryId
 /// </summary>
 /// <param name="monthlysalarydetailsinfo"></param>
 public void MonthlySalaryDetailsAddWithMonthlySalaryId(MonthlySalaryDetailsInfo monthlysalarydetailsinfo)
 {
     try
     {
     if (sqlcon.State == ConnectionState.Closed)
     {
         sqlcon.Open();
     }
     SqlCommand sccmd = new SqlCommand("MonthlySalaryDetailsAddWithMonthlySalaryId", sqlcon);
     sccmd.CommandType = CommandType.StoredProcedure;
     SqlParameter sprmparam = new SqlParameter();
     sprmparam = sccmd.Parameters.Add("@employeeId", SqlDbType.Decimal);
     sprmparam.Value = monthlysalarydetailsinfo.EmployeeId;
     sprmparam = sccmd.Parameters.Add("@salaryPackageId", SqlDbType.Decimal);
     sprmparam.Value = monthlysalarydetailsinfo.SalaryPackageId;
     sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
     sprmparam.Value = monthlysalarydetailsinfo.Extra1;
     sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
     sprmparam.Value = monthlysalarydetailsinfo.Extra2;
     sprmparam = sccmd.Parameters.Add("@monthlySalaryId", SqlDbType.Decimal);
     sprmparam.Value = monthlysalarydetailsinfo.MonthlySalaryId;
     sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
     MessageBox.Show(ex.ToString());
     }
     finally
     {
     sqlcon.Close();
     }
 }
        public void MonthlySalaryDetailsEditUsingMasterIdAndDetailsId(MonthlySalaryDetailsInfo monthlysalarydetailsinfo)
        {
            try
            {
                SpMonthlySalaryDetails.MonthlySalaryDetailsEditUsingMasterIdAndDetailsId(monthlysalarydetailsinfo);
            }

            catch (Exception ex)
            {
                MessageBox.Show("MSS2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        public void MonthlySalaryDetailsAddWithMonthlySalaryId(MonthlySalaryDetailsInfo InfoMonthlySalaryDetails)
        {
            try
            {
                SpMonthlySalaryDetails.MonthlySalaryDetailsAddWithMonthlySalaryId(InfoMonthlySalaryDetails);
            }

            catch (Exception ex)
            {
                MessageBox.Show("MSS1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// Function to get particular values from MonthlySalaryDetails table based on the parameter
 /// </summary>
 /// <param name="monthlySalaryDetailsId"></param>
 /// <returns></returns>
 public MonthlySalaryDetailsInfo MonthlySalaryDetailsView(decimal monthlySalaryDetailsId )
 {
     MonthlySalaryDetailsInfo monthlysalarydetailsinfo =new MonthlySalaryDetailsInfo();
     SqlDataReader sdrreader =null;
     try
     {
     if (sqlcon.State == ConnectionState.Closed)
     {
         sqlcon.Open();
     }
     SqlCommand sccmd = new SqlCommand("MonthlySalaryDetailsView", sqlcon);
     sccmd.CommandType = CommandType.StoredProcedure;
     SqlParameter sprmparam = new SqlParameter();
     sprmparam = sccmd.Parameters.Add("@monthlySalaryDetailsId", SqlDbType.Decimal);
     sprmparam.Value = monthlySalaryDetailsId;
      sdrreader = sccmd.ExecuteReader();
     while (sdrreader.Read())
     {
         monthlysalarydetailsinfo.MonthlySalaryDetailsId=Convert.ToDecimal(sdrreader[0].ToString());
         monthlysalarydetailsinfo.EmployeeId=Convert.ToDecimal(sdrreader[1].ToString());
         monthlysalarydetailsinfo.SalaryPackageId=Convert.ToDecimal(sdrreader[2].ToString());
         monthlysalarydetailsinfo.ExtraDate=Convert.ToDateTime(sdrreader[3].ToString());
         monthlysalarydetailsinfo.Extra1= sdrreader[4].ToString();
         monthlysalarydetailsinfo.Extra2= sdrreader[5].ToString();
     }
     }
     catch (Exception ex)
     {
     MessageBox.Show(ex.ToString());
     }
     finally
     {           sdrreader.Close();
     sqlcon.Close();
     }
     return monthlysalarydetailsinfo;
 }