private void CreateReport(ReportOrderedBy sOrder, bool includeZeroItems, string output) { if (!bUsingCatGroups) { string[] sCats = { InputTextBox("CAT").Text }; if (string.Equals(output, "P", StringComparison.OrdinalIgnoreCase)) { sEngine.StockReportToPrinter(sCats, sOrder, "", includeZeroItems); } else if (string.Equals(output, "S", StringComparison.OrdinalIgnoreCase)) { sEngine.StockReportToFile(sCats, sOrder, "", includeZeroItems); frmReportViewer fViewer = new frmReportViewer(ReportType.StockLevelReport); fViewer.ShowDialog(); } } else { string[] sCats = sEngine.GetListOfCatGroupCategories(InputTextBox("CAT").Text); if (string.Equals(output, "P", StringComparison.OrdinalIgnoreCase)) { sEngine.StockReportToPrinter(sCats, sOrder, InputTextBox("CAT").Text, includeZeroItems); } else if (string.Equals(output, "S", StringComparison.OrdinalIgnoreCase)) { sEngine.StockReportToFile(sCats, sOrder, InputTextBox("CAT").Text, includeZeroItems); frmReportViewer fViewer = new frmReportViewer(ReportType.StockLevelReport); fViewer.ShowDialog(); } } this.Close(); }
void SorpKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { InputTextBox("SUPCODE").Focus(); } else if (e.KeyCode == Keys.Enter) { if (InputTextBox("SORP").Text == "P") { sEngine.OutStandingItemsToPrinter(InputTextBox("SUPCODE").Text.ToUpper()); } else { sEngine.OutStandingItemsToFile(InputTextBox("SUPCODE").Text.ToUpper()); frmReportViewer frv = new frmReportViewer(ReportType.OutStandingItems); frv.ShowDialog(); } this.Close(); } }
void frmOutstandingItemsSetup_VisibleChanged(object sender, EventArgs e) { if (this.SkipCode != null && this.SkipCode.Length >= 2 && !this.SkipCode.Equals("N", StringComparison.OrdinalIgnoreCase)) { string printerOptions = SkipCode[SkipCode.Length - 1].ToString(); string supcode = SkipCode.Substring(0, SkipCode.Length - 1).ToUpper(); if (printerOptions.Equals("P", StringComparison.OrdinalIgnoreCase)) { sEngine.OutStandingItemsToPrinter(supcode); } else if (printerOptions.Equals("S", StringComparison.OrdinalIgnoreCase)) { sEngine.OutStandingItemsToFile(supcode); frmReportViewer frv = new frmReportViewer(ReportType.OutStandingItems); frv.ShowDialog(); } this.SkipCode = "N"; this.Close(); } }
private void CreateReport(SalesReportType sType, ReportOrderedBy rOrder, string output) { // Do Report if (output.Equals("S", StringComparison.OrdinalIgnoreCase)) { if (InputTextBox("DATE").Text != "" && System.IO.Directory.Exists(InputTextBox("DATE").Text)) { StockEngine sOldEngine = new StockEngine(InputTextBox("DATE").Text); sOldEngine.SalesReportToFile(InputTextBox("STARTCAT").Text, InputTextBox("ENDCAT").Text, sType, rtSelectedReport, rOrder); string sTitle = ""; switch (rtSelectedReport) { case Period.Daily: string sDate = sOldEngine.GetLastCollectionDate(); string sTitleDate = sDate[0].ToString() + sDate[1].ToString() + "/" + sDate[2].ToString() + sDate[3].ToString() + "/" + sDate[4].ToString() + sDate[5].ToString(); sTitle = "Daily Sales Report for " + sTitleDate; break; case Period.Weekly: sTitle = "Weekly Sales Report for Week Commencing " + sEngine.GetWeekCommencingDate(); break; case Period.Monthly: sTitle = "Monthly Sales Report for " + sEngine.GetMonthDate(); break; case Period.Yearly: string sLastCollection = sEngine.GetLastCollectionDate(); string sYear = sLastCollection[4].ToString() + sLastCollection[5].ToString(); sTitle = "Yearly Sales Report for " + "20" + sYear; break; } frmReportViewer fViewer = new frmReportViewer(ReportType.SalesReport); fViewer.ShowDialog(); this.Close(); } else { sEngine.SalesReportToFile(InputTextBox("STARTCAT").Text, InputTextBox("ENDCAT").Text, sType, rtSelectedReport, rOrder); string sTitle = ""; switch (rtSelectedReport) { case Period.Daily: string sDate = sEngine.GetLastCollectionDate(); string sTitleDate = sDate[0].ToString() + sDate[1].ToString() + "/" + sDate[2].ToString() + sDate[3].ToString() + "/" + sDate[4].ToString() + sDate[5].ToString(); sTitle = "Daily Sales Report for " + sTitleDate; break; case Period.Weekly: sTitle = "Weekly Sales Report for Week Commencing " + sEngine.GetWeekCommencingDate(); break; case Period.Monthly: sTitle = "Monthly Sales Report for " + sEngine.GetMonthDate(); break; case Period.Yearly: string sLastCollection = sEngine.GetLastCollectionDate(); string sYear = sLastCollection[4].ToString() + sLastCollection[5].ToString(); sTitle = "Yearly Sales Report for " + "20" + sYear; break; } frmReportViewer fViewer = new frmReportViewer(ReportType.SalesReport); fViewer.ShowDialog(); this.Close(); } } else if (output.Equals("P", StringComparison.OrdinalIgnoreCase)) { if (InputTextBox("DATE").Text != "" && System.IO.Directory.Exists(InputTextBox("DATE").Text)) { StockEngine sOldEngine = new StockEngine(InputTextBox("DATE").Text); sOldEngine.SalesReportToFile(InputTextBox("STARTCAT").Text, InputTextBox("ENDCAT").Text, sType, rtSelectedReport, rOrder); string sTitle = ""; switch (rtSelectedReport) { case Period.Daily: string sDate = sOldEngine.GetLastCollectionDate(); string sTitleDate = sDate[0].ToString() + sDate[1].ToString() + "/" + sDate[2].ToString() + sDate[3].ToString() + "/" + sDate[4].ToString() + sDate[5].ToString(); sTitle = "Daily Sales Report for " + sTitleDate; break; case Period.Weekly: sTitle = "Weekly Sales Report for Week Commencing " + sEngine.GetWeekCommencingDate(); break; case Period.Monthly: sTitle = "Monthly Sales Report for " + sEngine.GetMonthDate(); break; case Period.Yearly: string sLastCollection = sEngine.GetLastCollectionDate(); string sYear = sLastCollection[4].ToString() + sLastCollection[5].ToString(); sTitle = "Yearly Sales Report for " + "20" + sYear; break; } sOldEngine.SalesReportToPrinter(InputTextBox("STARTCAT").Text, InputTextBox("ENDCAT").Text, sType, rtSelectedReport, rOrder); this.Close(); } else { sEngine.SalesReportToFile(InputTextBox("STARTCAT").Text, InputTextBox("ENDCAT").Text, sType, rtSelectedReport, rOrder); string sTitle = ""; switch (rtSelectedReport) { case Period.Daily: string sDate = sEngine.GetLastCollectionDate(); string sTitleDate = sDate[0].ToString() + sDate[1].ToString() + "/" + sDate[2].ToString() + sDate[3].ToString() + "/" + sDate[4].ToString() + sDate[5].ToString(); sTitle = "Daily Sales Report for " + sTitleDate; break; case Period.Weekly: sTitle = "Weekly Sales Report for Week Commencing " + sEngine.GetWeekCommencingDate(); break; case Period.Monthly: sTitle = "Monthly Sales Report for " + sEngine.GetMonthDate(); break; case Period.Yearly: string sLastCollection = sEngine.GetLastCollectionDate(); string sYear = sLastCollection[4].ToString() + sLastCollection[5].ToString(); sTitle = "Yearly Sales Report for " + "20" + sYear; break; } sEngine.SalesReportToPrinter(InputTextBox("STARTCAT").Text, InputTextBox("ENDCAT").Text, sType, rtSelectedReport, rOrder); } } else if (output.Equals("T", StringComparison.OrdinalIgnoreCase)) { if (InputTextBox("DATE").Text != "" && System.IO.Directory.Exists(InputTextBox("DATE").Text)) { StockEngine sOldEngine = new StockEngine(InputTextBox("DATE").Text); sOldEngine.SalesReportToSpreadsheet(InputTextBox("STARTCAT").Text, InputTextBox("ENDCAT").Text, sType, rtSelectedReport, rOrder); string sTitle = ""; switch (rtSelectedReport) { case Period.Daily: string sDate = sOldEngine.GetLastCollectionDate(); string sTitleDate = sDate[0].ToString() + sDate[1].ToString() + "/" + sDate[2].ToString() + sDate[3].ToString() + "/" + sDate[4].ToString() + sDate[5].ToString(); sTitle = "Daily Sales Report for " + sTitleDate; break; case Period.Weekly: sTitle = "Weekly Sales Report for Week Commencing " + sEngine.GetWeekCommencingDate(); break; case Period.Monthly: sTitle = "Monthly Sales Report for " + sEngine.GetMonthDate(); break; case Period.Yearly: string sLastCollection = sEngine.GetLastCollectionDate(); string sYear = sLastCollection[4].ToString() + sLastCollection[5].ToString(); sTitle = "Yearly Sales Report for " + "20" + sYear; break; } this.Close(); } else { sEngine.SalesReportToSpreadsheet(InputTextBox("STARTCAT").Text, InputTextBox("ENDCAT").Text, sType, rtSelectedReport, rOrder); string sTitle = ""; switch (rtSelectedReport) { case Period.Daily: string sDate = sEngine.GetLastCollectionDate(); string sTitleDate = sDate[0].ToString() + sDate[1].ToString() + "/" + sDate[2].ToString() + sDate[3].ToString() + "/" + sDate[4].ToString() + sDate[5].ToString(); sTitle = "Daily Sales Report for " + sTitleDate; break; case Period.Weekly: sTitle = "Weekly Sales Report for Week Commencing " + sEngine.GetWeekCommencingDate(); break; case Period.Monthly: sTitle = "Monthly Sales Report for " + sEngine.GetMonthDate(); break; case Period.Yearly: string sLastCollection = sEngine.GetLastCollectionDate(); string sYear = sLastCollection[4].ToString() + sLastCollection[5].ToString(); sTitle = "Yearly Sales Report for " + "20" + sYear; break; } } } this.Close(); }