コード例 #1
0
ファイル: UcLoadSale.cs プロジェクト: KornHxH/RubberSoft
        private void Load_RptSaleBill1(int SaleId)
        {
            try
            {
                string sPrinterName;

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

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

                subRptWeightBalance subreport = new subRptWeightBalance();

                DataSet dss = SQLSale.Rpt_GetWeightBalance(SaleId);
                subreport.DataSource = dss.Tables[0];
                subreport.DataMember = "Datatable1";

                report.xrSubWeightBalance.ReportSource = subreport;

                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);
            }
        }
コード例 #2
0
        private void Load_RptBuyBill(int BuyId)
        {
            try
            {
                string sPrinterName;

                DataSet ds = SQLReport.Spt_GetBuyBill(BuyId);

                RptBuyBill report = new RptBuyBill();
                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);
            }
        }