Пример #1
0
 /// <summary>
 /// on "print'  button click for print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvServiceReport.RowCount > 0)
         {
             DataSet         dsServiceVoucherReport = new DataSet();
             CompanySP       spCompany                = new CompanySP();
             frmReport       reportobj                = new frmReport();
             ServiceMasterSP spServiceMaster          = new ServiceMasterSP();
             DataTable       dtblCompany              = spCompany.CompanyViewDataTable(1);
             DataTable       dtblServiceVoucherReport = spServiceMaster.ServiceReport(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text, cmbCashOrParty.Text, cmbSalesman.Text);
             dsServiceVoucherReport.Tables.Add(dtblCompany);
             dsServiceVoucherReport.Tables.Add(dtblServiceVoucherReport);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.ServiceVoucherReport(dsServiceVoucherReport);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SVRT15:" + ex.Message;
     }
 }
Пример #2
0
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         ServiceMasterSP spServiceMaster = new ServiceMasterSP();
         DataTable       dtbl            = new DataTable();
         dtbl = spServiceMaster.ServiceReportSearch(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text.Trim(), cmbCashOrParty.Text.ToString(), cmbSalesman.Text.ToString());
         dgvServiceReport.DataSource = dtbl;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SVRT9:" + ex.Message;
     }
 }
Пример #3
0
 /// <summary>
 /// Fills Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         if (cmbCashOrParty.Text.Trim() == string.Empty)
         {
             cmbCashOrParty.Text = "All";
         }
         ServiceMasterSP spServiceMaster = new ServiceMasterSP();
         DataTable       dtbl            = new DataTable();
         dtbl = spServiceMaster.ServiceVoucherRegisterSearch(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), txtVoucherNo.Text.Trim(), cmbCashOrParty.Text.ToString());
         dgvServiceVoucherRegister.DataSource = dtbl;
         if (cmbCashOrParty.Text == "All")
         {
             cmbCashOrParty.Text = string.Empty;
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SVREG2:" + ex.Message;
     }
 }