/// <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) { MessageBox.Show("SPD:9 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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) { MessageBox.Show("SPD:2 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public List <DataTable> SalaryPackageViewAllForSalaryPackageReport(string strPackageName, string strStatus) { List <DataTable> ListObj = new List <DataTable>(); try { ListObj = SalaryPackage.SalaryPackageViewAllForSalaryPackageReport(strPackageName, strStatus); } catch (Exception ex) { MessageBox.Show("AL2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(ListObj); }