Exemple #1
0
        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);
        }
Exemple #2
0
        private void ProcessHtmlToolSUB()
        {
            ToolSUB report = GetReportFactory().GetReportToolSUB(StartPeriod, EndPeriod, GetClientID());

            LoadGridSUB(report.Items, report.Summaries);
            SetLinkText("sub", "tool");
        }
Exemple #3
0
        public ToolSUB GetToolSUB(DateTime sd, DateTime ed, int id = 0)
        {
            ToolSUB report = new ToolSUB {
                StartPeriod = sd, EndPeriod = ed, ClientID = id
            };

            ToolServiceUnitBillingGenerator.Create(Session, report).Generate();
            return(report);
        }
Exemple #4
0
        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");
        }
Exemple #5
0
        private void ProcessExcelToolSUB()
        {
            string filePath;

            if (StartPeriod >= ReportSettings.July2009)
            {
                ToolSUB report = GetReportFactory().GetReportToolSUB(StartPeriod, EndPeriod, GetClientID());
                filePath = GenerateExcelSUB(report.Items, report.Summaries, "Tool");
            }
            else
            {
                BillingUnit SummaryUnit = new BillingUnit();
                ToolReport  rpt         = new ToolReport(StartPeriod, EndPeriod);
                DataTable   dtTool      = rpt.GenerateDataTable(SummaryUnit);
                filePath = rpt.GenerateExcelFile(dtTool);
            }

            OutputExcel(filePath);
        }