/// <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 (dgvDailySalary.RowCount > 0) { DataSet ds = new DataSet(); //CompanySP spCompany = new CompanySP(); CompanyCreationBll bllCompanyCreation = new CompanyCreationBll(); EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll(); List <DataTable> listEmployee = BllEmployeeCreation.EmployeeViewAllForDailySalaryReport(cmbEmployeeCode.Text, cmbDesignation.Text, Convert.ToDateTime(dtpFromDate.Text.ToString()), Convert.ToDateTime(dtpToDate.Text.ToString()), cmbStatus.Text); List <DataTable> listObjCompany = bllCompanyCreation.CompanyViewDataTable(1); ds.Tables.Add(listObjCompany[0]); ds.Tables.Add(listEmployee[0]); frmReport frmReportObj = new frmReport(); frmReportObj.MdiParent = formMDI.MDIObj; frmReportObj.DailySalaryReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("DSR9 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> public void GridFill() { try { List <DataTable> listEmployee = BllEmployeeCreation.EmployeeViewAllForDailySalaryReport(cmbEmployeeCode.Text, cmbDesignation.Text, Convert.ToDateTime(dtpFromDate.Text.ToString()), Convert.ToDateTime(dtpToDate.Text.ToString()), cmbStatus.Text); dgvDailySalary.DataSource = listEmployee[0]; } catch (Exception ex) { MessageBox.Show("DSR4" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }