private void ProcessHtmlStoreSUB(bool twoCreditAccounts) { StoreSUB report = GetReportFactory().GetReportStoreSUB(StartPeriod, EndPeriod, twoCreditAccounts, GetClientID()); LoadGridSUB(report.Items, report.Summaries); SetLinkText("sub", "store", twoCreditAccounts); }
private void ProcessHtmlAllSUB() { var factory = GetReportFactory(); RoomSUB roomSUB = factory.GetReportRoomSUB(StartPeriod, EndPeriod, GetClientID()); ToolSUB toolSUB = factory.GetReportToolSUB(StartPeriod, EndPeriod, GetClientID()); StoreSUB storeSUB = factory.GetReportStoreSUB(StartPeriod, EndPeriod, false, GetClientID()); IEnumerable <ServiceUnitBillingReportItem> allItems = ReportFactory.GetAllSUB(roomSUB, toolSUB, storeSUB, out double total); gvSUB.Columns[1].Visible = true; gvSUB.Columns[2].Visible = EndPeriod != StartPeriod.AddMonths(1); gvSUB.DataSource = allItems; gvSUB.DataBind(); SetTotalText(total); SetLinkText("sub", "all"); }
public StoreSUB GetStoreSUB(DateTime sd, DateTime ed, int id = 0, string option = null) { var twoCreditAccounts = false; if (!string.IsNullOrEmpty(option)) { twoCreditAccounts = option == "two-credit-accounts"; } StoreSUB report = new StoreSUB { StartPeriod = sd, EndPeriod = ed, ClientID = id, TwoCreditAccounts = twoCreditAccounts }; StoreServiceUnitBillingGenerator.Create(Session, report).Generate(); return(report); }
private void ProcessExcelStoreSUB(bool twoCreditAccounts) { string filePath; if (twoCreditAccounts) { if (StartPeriod >= ReportSettings.July2009) { StoreSUB report = GetReportFactory().GetReportStoreSUB(StartPeriod, EndPeriod, twoCreditAccounts, GetClientID()); filePath = GenerateExcelSUB(report.Items, report.Summaries, "Store"); } else { BillingUnit SummaryUnit1 = new BillingUnit(); BillingUnit SummaryUnit2 = new BillingUnit(); StoreReport rpt = new StoreReport(StartPeriod, EndPeriod); DataTable dtStore = rpt.GenerateDataTable(SummaryUnit1, SummaryUnit2); filePath = rpt.GenerateExcelFile(dtStore); } } else { if (StartPeriod >= ReportSettings.July2009) { StoreSUB report = GetReportFactory().GetReportStoreSUB(StartPeriod, EndPeriod, twoCreditAccounts, GetClientID()); filePath = GenerateExcelSUB(report.Items, report.Summaries, "Store"); } else { BillingUnit SummaryUnit1 = new BillingUnit(); BillingUnit SummaryUnit2 = new BillingUnit(); StoreReport rpt = new StoreReport(StartPeriod, EndPeriod); DataTable dtStore = rpt.GenerateDataTable(SummaryUnit1, SummaryUnit2); filePath = rpt.GenerateExcelFile(dtStore); } } OutputExcel(filePath); }
public static List <ServiceUnitBillingReportItem> GetAllSUB(RoomSUB roomSUB, ToolSUB toolSUB, StoreSUB storeSUB, out double total) { var allItems = new List <ServiceUnitBillingReportItem>(); allItems.AddRange(roomSUB.CombinedItems); allItems.AddRange(toolSUB.CombinedItems); allItems.AddRange(storeSUB.CombinedItems); total = 0; foreach (var bu in roomSUB.Summaries) { total += bu.MerchandiseAmount; } foreach (var bu in toolSUB.Summaries) { total += bu.MerchandiseAmount; } foreach (var bu in storeSUB.Summaries) { total += bu.MerchandiseAmount; } return(allItems); }