/// <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 (dgvSalaryPackage.RowCount > 0) { frmReport frmreport = new frmReport(); DataSet ds = new DataSet(); SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); CompanySP spCompany = new CompanySP(); DataTable dtblSalaryPackage = spSalaryPackage.SalaryPackageViewAllForSalaryPackageReport(cmbPackageName.Text, cmbStatus.Text); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblSalaryPackage); ds.Tables.Add(dtblCompany); frmreport.MdiParent = formMDI.MDIObj; frmreport.SalaryPackageReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { formMDI.infoError.ErrorString = "SPR:9 " + ex.Message; } }
/// <summary> /// Function to fill Datagridview /// </summary> public void GridFill() { try { SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); DataTable dtbl = spSalaryPackage.SalaryPackageViewAllForSalaryPackageReport(cmbPackageName.Text, cmbStatus.Text); dgvSalaryPackage.DataSource = dtbl; } catch (Exception ex) { formMDI.infoError.ErrorString = "SPR:2 " + ex.Message; } }