Exemplo n.º 1
0
        private DataTable GetOldDayData()
        {
            var fleetTypes = "RAC OPS";
            // CARSALES, RAC TTL, RAC OPS, HERTZ ON DEMAND (Firefly), LICENSEE
            var dataTable = AvailabilityHistoricalTrend.GetHistoricalTrendData("GE", -1, -1, -1, -1, "-1", fleetTypes, -1, -1, -1,
                                                                               FromDate, ToDate, -1, "DAY", "NUMERIC", "-1");

            return(dataTable);
        }
Exemplo n.º 2
0
        protected void GenerateReport()
        {
            //Set default values
            int      logic                 = -1;
            string   country               = "-1";
            int      cms_pool_id           = -1;
            string   cms_pool              = null;
            int      cms_location_group_id = -1;
            string   cms_location_group    = null;
            int      ops_region_id         = -1;
            string   ops_region            = null;
            int      ops_area_id           = -1;
            string   ops_area              = null;
            int      car_segment_id        = -1;
            string   car_segment           = null;
            int      car_class_id          = -1;
            string   car_class             = null;
            int      car_group_id          = -1;
            string   car_group             = null;
            DateTime availabilityDate      = DateTime.Now;
            int      dayOfWeekValue        = -1;
            string   dayOfWeek             = null;
            int      dateRangeValue        = -1;
            string   dateRange             = null;
            string   location              = "-1";
            string   fleetName             = "-1";

            //Pass values from usercontrol
            logic   = this.UserControlReportSettings.Logic;
            country = this.UserControlReportSettings.Country;

            switch (logic)
            {
            case (int)ReportSettings.OptionLogic.CMS:
                cms_pool_id           = this.UserControlReportSettings.CMS_Pool_Id;
                cms_pool              = this.UserControlReportSettings.CMS_Pool;
                cms_location_group_id = this.UserControlReportSettings.CMS_Location_Group_Id;
                cms_location_group    = this.UserControlReportSettings.CMS_Location_Group;

                break;

            case (int)ReportSettings.OptionLogic.OPS:
                ops_region_id = this.UserControlReportSettings.OPS_Region_Id;
                ops_region    = this.UserControlReportSettings.OPS_Region;
                ops_area_id   = this.UserControlReportSettings.OPS_Area_Id;
                ops_area      = this.UserControlReportSettings.OPS_Area;

                break;
            }

            car_segment_id = this.UserControlReportSettings.Car_Segment_Id;
            car_segment    = this.UserControlReportSettings.Car_Segment;
            car_class_id   = this.UserControlReportSettings.Car_Class_Id;
            car_class      = this.UserControlReportSettings.Car_Class;
            car_group_id   = this.UserControlReportSettings.Car_Group_Id;
            car_group      = this.UserControlReportSettings.Car_Group;

            location  = this.UserControlReportSettings.Location;
            fleetName = this.UserControlReportSettings.Fleet_Name;

            availabilityDate = this.UserControlReportSettings.DateAvailability;
            dayOfWeekValue   = this.UserControlReportSettings.DayOfWeekValue;
            dayOfWeek        = this.UserControlReportSettings.DayOfWeek;
            DateTime startDate = DateTime.Now;

            if (UserControlReportSettings.DateRangeValue.Contains("Custom"))
            {
                startDate        = UserControlReportSettings.customStartDate;
                availabilityDate = UserControlReportSettings.customEndDate;
                TimeSpan ts = startDate - availabilityDate;
                dateRangeValue = ts.Days;
            }
            else
            {
                dateRangeValue = Convert.ToInt32(this.UserControlReportSettings.DateRangeValue);
                dateRange      = this.UserControlReportSettings.DateRange;
                if (dateRangeValue == -1)
                {
                    startDate = availabilityDate.AddDays(dateRangeValue + 1);
                }
                else
                {
                    startDate = availabilityDate.AddDays(dateRangeValue);
                }
            }

            string availabilityLogic = this.UserControlReportSettings.AvailabilityLogic;
            string grouping_criteria = ReportSettings.getRangeGroupingCriteria(dateRangeValue);

            var onRentType = UserControlReportSettings.OnRentTypeSelected;

            //Set Last Selection Value
            base.SaveLastSelectionToSession(logic, country, cms_pool_id, cms_location_group_id, ops_region_id, ops_area_id, location, car_segment_id, car_class_id, car_group_id);
            SessionHandler.OnRentTypeSelected = onRentType;

            //Load Data
            this.GenerateChart(AvailabilityHistoricalTrend.GetHistoricalTrendData(country, cms_pool_id, cms_location_group_id, ops_region_id, ops_area_id, location, fleetName, car_segment_id, car_class_id, car_group_id,
                                                                                  startDate, availabilityDate, dayOfWeekValue, grouping_criteria, availabilityLogic, onRentType), dateRangeValue, availabilityLogic);


            //Set report Selection
            this.SetReportSelection(logic, country, cms_pool_id, cms_location_group_id, ops_region_id, ops_area_id, car_segment_id, car_class_id, car_group_id, location,
                                    startDate, dayOfWeekValue, dateRangeValue);



            //Log Usage Statistics
            base.LogUsageStatistics((int)ReportStatistics.ReportName.AvailabilityHistoricalTrend, country, cms_pool_id, cms_location_group_id, ops_region_id, ops_area_id, location);


            this.UpdatePanelHistoricalTrend.Update();
        }