Пример #1
0
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         EmployeeSP spEmployee = new EmployeeSP();
         DataTable dtbl = spEmployee.EmployeeViewAllEmployeeReport(cmbDesigantion.Text, cmbEmployee.Text, cmbStatus.Text);
         dgvEmployee.DataSource = dtbl;
     }
     catch (Exception ex)
     {
         MessageBox.Show("ER3 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #2
0
 /// <summary>
 /// On 'Print' button click to take print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvEmployee.RowCount > 0)
         {
             DataSet ds = new DataSet();
             CompanySP spCompany = new CompanySP();
             DataTable dtblCompany = spCompany.CompanyViewDataTable(1);
             ds.Tables.Add(dtblCompany);
             EmployeeSP spEmployee = new EmployeeSP();
             DataTable dtblEmployee = spEmployee.EmployeeViewAllEmployeeReport(cmbDesigantion.Text, cmbEmployee.Text, cmbStatus.Text);
             ds.Tables.Add(dtblEmployee);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.EmployeeReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("ER9" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }