示例#1
0
 public void paymentVoucher(long paymentVoucherId)
 {
     try
     {
         DataTable dt           = accountDetailsController.getPaymentVoucherPrint(paymentVoucherId, Utility.FinancilaYearId);
         string    AmountInWord = null;
         if (Utility.Langn == "English")
         {
             AmountInWord = Utility.NumberToWordMarathi(Convert.ToInt64(dt.Rows[0]["drAmount"].ToString())) + " " + "rupees /- Only.";;
         }
         else
         {
             AmountInWord = Utility.NumberToWordMarathi(Convert.ToInt64(dt.Rows[0]["drAmount"].ToString())) + " " + "रुपये /- फक्त.";;
         }
         double             crDrAmount = Math.Round(accountDetailsController.getPaymentDueAmount(Convert.ToInt64(dt.Rows[0]["accountId"])), 2);
         crptPaymentVoucher rpt        = new crptPaymentVoucher();
         RptSaleBill        frm        = new RptSaleBill();
         // rpt.SetDataSource(dt);
         rpt.Database.Tables[0].SetDataSource(dt);
         rpt.Database.Tables[1].SetDataSource(Utility.dtGenericBillInfo);
         rpt.SetParameterValue(0, crDrAmount.ToString());
         rpt.SetParameterValue(1, AmountInWord);
         frm.crystalReportViewer1.ReportSource = rpt;
         frm.Refresh();
         frm.crystalReportViewer1.Refresh();
         frm.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        public void bill(DataSet dt)
        {
            try
            {
                System.Globalization.RegionInfo objRegInfo = new RegionInfo("en-IN");
                string syb = objRegInfo.CurrencySymbol;

                DataTable dtSale = dt.Tables[0];
                //  DataTable dtSaleByHSNCode = dt.Tables[1];
                string amountInWord = Utility.NumberToWordMarathi(Convert.ToInt64(dtSale.Rows[0]["netBillAmount"].ToString()));
                dtSale.Columns.Add(new DataColumn("amountInWord", typeof(string)));
                foreach (DataRow dr in dtSale.Rows)
                {
                    dr["amountInWord"] = amountInWord + " " + "रुपये /- फक्त.";;
                }
                RptCustomerBill rpt = new RptCustomerBill();
                RptSaleBill     frm = new RptSaleBill();
                rpt.Database.Tables[0].SetDataSource(dtSale);
                rpt.Database.Tables[1].SetDataSource(Utility.dtGenericBillInfo);
                //   rpt.Subreports[0].SetDataSource(dtSaleByHSNCode);
                string outstanding = Math.Round(accountDetailsController.GetDueAmount(Convert.ToInt64(dtSale.Rows[0]["customerId"]), "customer", Utility.FinancilaYearId, Convert.ToDateTime(dtSale.Rows[0]["salesDate"])), 2).ToString();
                bool   isWholeSale = Convert.ToInt32(dtSale.Rows[0]["isWholeSale"].ToString()) == 1?true:false;
                rpt.SetParameterValue(0, outstanding);
                rpt.SetParameterValue(1, isWholeSale);
                frm.crystalReportViewer1.ReportSource = rpt;
                frm.Refresh();
                frm.crystalReportViewer1.Refresh();
                frm.ShowDialog();
            }
            catch (Exception ae)
            {
                throw ae;
            }
        }
示例#3
0
        private void Load_RptSaleBill(int SaleId)
        {
            try
            {
                string sPrinterName;

                DataSet ds = SQLReport.Spt_GetSaleBill(SaleId, sCustomerId);

                RptSaleBill report = new RptSaleBill();
                report.DataSource = ds.Tables[0];
                report.DataMember = "Datatable1";

                if (sActive == false)
                {
                    report.lblHeader.Text = "ใบยกเลิกรายการขายน้ำยาง";
                }

                FrmPayment frm = new FrmPayment();
                frm.DocShowBill.DocumentSource = report;
                frm.sMessage          = "";
                frm.BtnCloseBill.Text = "พิมพ์";
                frm.PrintType         = 2;

                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    sPrinterName       = frm.sPrinterName;
                    report.PrinterName = sPrinterName;
                    report.Print(sPrinterName);
                }

                //PrintBill(report);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }