/// <summary>
 /// On 'Print' button click to Print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvSalaryPackageDetails.RowCount > 0)
         {
             DataTable dtblOther = new DataTable();
             frmReport frmreport = new frmReport();
             DataSet   ds        = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll       bllCompanyCreation      = new CompanyCreationBll();
             List <DataTable>         listObjCompany          = bllCompanyCreation.CompanyViewDataTable(1);
             SalaryPackageCreationBll bllSalaryPackageDetails = new SalaryPackageCreationBll();
             List <DataTable>         ListObj = bllSalaryPackageDetails.SalaryPackageDetailsForSalaryPackageDetailsReport(cmbSalaryPackage.Text);
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(ListObj[0]);
             ds.Tables.Add(dtblOther);
             DataColumn dc = new DataColumn("Addition", typeof(decimal));
             dtblOther.Columns.Add(dc);
             dc = new DataColumn("Deduction", typeof(decimal));
             dtblOther.Columns.Add(dc);
             DataRow dr = dtblOther.NewRow();
             dr[0] = decCountAdditon;
             dr[1] = decCountDeduction;
             dtblOther.Rows.InsertAt(dr, 0);
             frmreport.MdiParent = formMDI.MDIObj;
             frmreport.SalaryPackageDetailsReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPDR:7" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         SalaryPackageCreationBll bllSalaryPackageDetails = new SalaryPackageCreationBll();
         List <DataTable>         ListObj = bllSalaryPackageDetails.SalaryPackageDetailsForSalaryPackageDetailsReport(cmbSalaryPackage.Text);
         dgvSalaryPackageDetails.DataSource = ListObj;
         decCountAdditon   = 0;
         decCountDeduction = 0;
         decTotalAmount    = 0;
         foreach (DataGridViewRow dgvRaw in dgvSalaryPackageDetails.Rows)
         {
             if (dgvRaw.Cells["dgvtxttype"].Value.ToString() == "Addition")
             {
                 decimal decAmt = Convert.ToDecimal(dgvRaw.Cells["txtAmount"].Value.ToString());
                 decCountAdditon = decCountAdditon + decAmt;
             }
             else
             {
                 decimal decAmt = Convert.ToDecimal(dgvRaw.Cells["txtAmount"].Value.ToString());
                 decCountDeduction = decCountDeduction + decAmt;
             }
             if (dgvRaw.Cells["txtAmount"].Value != null && dgvRaw.Cells["txtAmount"].Value.ToString() != "")
             {
                 decimal decAmt = Convert.ToDecimal(dgvRaw.Cells["txtAmount"].Value.ToString());
                 decTotalAmount = decTotalAmount + decAmt;
             }
         }
         txttotalReduction.Text = Math.Round(decCountDeduction, PublicVariables._inNoOfDecimalPlaces).ToString();
         txttotalAddition.Text  = Math.Round(decCountAdditon, PublicVariables._inNoOfDecimalPlaces).ToString(); //Convert.ToString(decCountAdditon);
         txtTotal.Text          = Math.Round(decTotalAmount, PublicVariables._inNoOfDecimalPlaces).ToString();  //Convert.ToString(decTotalAmount);
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPDR:1" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }