public void PrintPLUReportPerOrderSlipPrinter() { Data.CashierReports clsCashierReport = new Data.CashierReports(mConnection, mTransaction); mConnection = clsCashierReport.Connection; mTransaction = clsCashierReport.Transaction; Data.CashierReportDetails clsCashierReportDetails = clsCashierReport.Details(mclsSalesTransactionDetails.CashierID, Constants.TerminalBranchID, mclsTerminalDetails.TerminalNo); clsCashierReport.GeneratePLUReport(mclsTerminalDetails.BranchDetails.BranchID, mclsTerminalDetails.TerminalNo, false, mCashierName); Data.PLUReport clsPLUReport = new Data.PLUReport(mConnection, mTransaction); System.Data.DataTable dtpluReport = clsPLUReport.ListAsDataTable(mclsTerminalDetails.BranchDetails.BranchID, mclsTerminalDetails.TerminalNo); clsCashierReport.CommitAndDispose(); DateTime StartDate = clsCashierReportDetails.LastLoginDate; DateTime EndDate = DateTime.Now; DialogResult result = DialogResult.OK; if (mclsTerminalDetails.PreviewTerminalReport) { PLUReportWnd clsPLUReportWnd = new PLUReportWnd(); clsPLUReportWnd.TerminalDetails = mclsTerminalDetails; clsPLUReportWnd.CashierName = mCashierName; clsPLUReportWnd.dtPLUReport = dtpluReport; clsPLUReportWnd.CashierReportDetail = clsCashierReportDetails; clsPLUReportWnd.StartDate = StartDate; clsPLUReportWnd.EndDate = EndDate; clsPLUReportWnd.ShowDialog(this); result = clsPLUReportWnd.Result; clsPLUReportWnd.Close(); clsPLUReportWnd.Dispose(); } if (result == DialogResult.OK) { // put variables in which printer to print int iRetailPlusOSPrinter1Ctr = 0; int iRetailPlusOSPrinter2Ctr = 0; int iRetailPlusOSPrinter3Ctr = 0; int iRetailPlusOSPrinter4Ctr = 0; int iRetailPlusOSPrinter5Ctr = 0; foreach (System.Data.DataRow dr in dtpluReport.Rows) { bool orderSlipPrinter1 = bool.Parse(dr["OrderSlipPrinter1"].ToString()); bool orderSlipPrinter2 = bool.Parse(dr["OrderSlipPrinter2"].ToString()); bool orderSlipPrinter3 = bool.Parse(dr["OrderSlipPrinter3"].ToString()); bool orderSlipPrinter4 = bool.Parse(dr["OrderSlipPrinter4"].ToString()); bool orderSlipPrinter5 = bool.Parse(dr["OrderSlipPrinter5"].ToString()); if (orderSlipPrinter1) { iRetailPlusOSPrinter1Ctr++; } if (orderSlipPrinter2) { iRetailPlusOSPrinter2Ctr++; } if (orderSlipPrinter3) { iRetailPlusOSPrinter3Ctr++; } if (orderSlipPrinter4) { iRetailPlusOSPrinter4Ctr++; } if (orderSlipPrinter5) { iRetailPlusOSPrinter5Ctr++; } } if (iRetailPlusOSPrinter1Ctr > 0) PrintPLUReportPerOrderSlipPrinter(dtpluReport, clsCashierReportDetails, StartDate, EndDate, AceSoft.RetailPlus.OrderSlipPrinter.RetailPlusOSPrinter1); if (iRetailPlusOSPrinter2Ctr > 0) PrintPLUReportPerOrderSlipPrinter(dtpluReport, clsCashierReportDetails, StartDate, EndDate, AceSoft.RetailPlus.OrderSlipPrinter.RetailPlusOSPrinter2); if (iRetailPlusOSPrinter3Ctr > 0) PrintPLUReportPerOrderSlipPrinter(dtpluReport, clsCashierReportDetails, StartDate, EndDate, AceSoft.RetailPlus.OrderSlipPrinter.RetailPlusOSPrinter3); if (iRetailPlusOSPrinter4Ctr > 0) PrintPLUReportPerOrderSlipPrinter(dtpluReport, clsCashierReportDetails, StartDate, EndDate, AceSoft.RetailPlus.OrderSlipPrinter.RetailPlusOSPrinter4); if (iRetailPlusOSPrinter5Ctr > 0) PrintPLUReportPerOrderSlipPrinter(dtpluReport, clsCashierReportDetails, StartDate, EndDate, AceSoft.RetailPlus.OrderSlipPrinter.RetailPlusOSPrinter5); } }
public void PrintPLUReport() { Data.CashierReports clsCashierReport = new Data.CashierReports(mConnection, mTransaction); mConnection = clsCashierReport.Connection; mTransaction = clsCashierReport.Transaction; Data.CashierReportDetails clsCashierReportDetails = clsCashierReport.Details(mclsSalesTransactionDetails.CashierID, Constants.TerminalBranchID, mclsTerminalDetails.TerminalNo); clsCashierReport.GeneratePLUReport(mclsTerminalDetails.BranchDetails.BranchID, mclsTerminalDetails.TerminalNo, false, mCashierName); Data.PLUReport clsPLUReport = new Data.PLUReport(mConnection, mTransaction); mConnection = clsPLUReport.Connection; mTransaction = clsPLUReport.Transaction; System.Data.DataTable dtpluReport = clsPLUReport.ListAsDataTable(mclsTerminalDetails.BranchDetails.BranchID, mclsTerminalDetails.TerminalNo); clsCashierReport.CommitAndDispose(); DateTime StartDate = clsCashierReportDetails.LastLoginDate; DateTime EndDate = DateTime.Now; DialogResult result = DialogResult.OK; if (mclsTerminalDetails.PreviewTerminalReport) { PLUReportWnd clsPLUReportWnd = new PLUReportWnd(); clsPLUReportWnd.TerminalDetails = mclsTerminalDetails; clsPLUReportWnd.CashierName = mCashierName; clsPLUReportWnd.dtPLUReport = dtpluReport; clsPLUReportWnd.CashierReportDetail = clsCashierReportDetails; clsPLUReportWnd.StartDate = StartDate; clsPLUReportWnd.EndDate = EndDate; clsPLUReportWnd.ShowDialog(this); result = clsPLUReportWnd.Result; clsPLUReportWnd.Close(); clsPLUReportWnd.Dispose(); } if (result == DialogResult.OK) { //PrintPLUReportDelegate plureportDel = new PrintPLUReportDelegate(PrintPLUReport); PrintPLUReport(dtpluReport, clsCashierReportDetails, StartDate, EndDate); } }