Ejemplo n.º 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)
     {
         MessageBox.Show("SVRT 15 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Function to get values for report based on parameter
        /// </summary>
        /// <param name="dtDateFrom"></param>
        /// <param name="dtDateTo"></param>
        /// <param name="strVoucherTypeName"></param>
        /// <param name="strLedgerName"></param>
        /// <param name="strEmployeeName"></param>
        /// <returns></returns>
        public List <DataTable> ServiceReport(DateTime dtDateFrom, DateTime dtDateTo, string strVoucherTypeName, string strLedgerName, string strEmployeeName)
        {
            List <DataTable> ListObj = new List <DataTable>();

            try
            {
                ListObj = spServiceMaster.ServiceReport(dtDateFrom, dtDateTo, strVoucherTypeName, strLedgerName, strEmployeeName);
            }
            catch (Exception ex)
            {
                MessageBox.Show("AL35:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(ListObj);
        }