Beispiel #1
0
        protected void SetReportSelection(int selectedLogic, string country, int cms_pool_id, int cms_location_group_id, int ops_region_id, int ops_area_id, int car_segment_id, int car_class_id, string location, DateTime start_date,
                                          int dayOfWeek, int dateRange)
        {
            //Set Report Selection User Control
            //Logic
            this.UserControlReportSelections.Logic = selectedLogic;

            //Country
            if (country == "-1")
            {
                this.UserControlReportSelections.Country = Resources.lang.ReportSettingsALLSelection;
            }
            else
            {
                this.UserControlReportSelections.Country = country;
            }

            //Select logic
            switch (selectedLogic)
            {
            case (int)ReportSettings.OptionLogic.CMS:
                //CMS Pool
                if (cms_pool_id == -1)
                {
                    this.UserControlReportSelections.CMS_Pool = Resources.lang.ReportSettingsALLSelection;
                }
                else
                {
                    this.UserControlReportSelections.CMS_Pool = this.UserControlReportSettings.CMS_Pool;
                }
                //CMS Location Group
                if (cms_location_group_id == -1)
                {
                    this.UserControlReportSelections.CMS_Location_Group = Resources.lang.ReportSettingsALLSelection;
                }
                else
                {
                    this.UserControlReportSelections.CMS_Location_Group = this.UserControlReportSettings.CMS_Location_Group;
                }

                break;

            case (int)ReportSettings.OptionLogic.OPS:
                //OPS Region
                if (ops_region_id == -1)
                {
                    this.UserControlReportSelections.OPS_Region = Resources.lang.ReportSettingsALLSelection;
                }
                else
                {
                    this.UserControlReportSelections.OPS_Region = this.UserControlReportSettings.OPS_Region;
                }
                //OPS Area
                if (ops_area_id == -1)
                {
                    this.UserControlReportSelections.OPS_Area = Resources.lang.ReportSettingsALLSelection;
                }
                else
                {
                    this.UserControlReportSelections.OPS_Area = this.UserControlReportSettings.OPS_Area;
                }
                break;
            }

            //Location
            if (location == "-1")
            {
                this.UserControlReportSelections.Location = Resources.lang.ReportSettingsALLSelection;
            }
            else
            {
                this.UserControlReportSelections.Location = location;
            }

            //Car Segment
            if (car_segment_id == -1)
            {
                this.UserControlReportSelections.Car_Segment = Resources.lang.ReportSettingsALLSelection;
            }
            else
            {
                this.UserControlReportSelections.Car_Segment = this.UserControlReportSettings.Car_Segment;
            }

            //Car Class
            if (car_class_id == -1)
            {
                this.UserControlReportSelections.Car_Class = Resources.lang.ReportSettingsALLSelection;
            }
            else
            {
                this.UserControlReportSelections.Car_Class = this.UserControlReportSettings.Car_Class;
            }

            this.UserControlReportSelections.StartDate = string.Format("{0:dd/MM/yyyy}", start_date);
            this.UserControlReportSelections.DayOfWeek = ReportSettings.GetDayOfWeek(dayOfWeek);
            this.UserControlReportSelections.DateRange = UserControlReportSettings.DateRangeValue.Contains("Custom") ? "Custom" : ReportSettings.GetDateRange(dateRange);



            //Set Report Selection for tool and page
            this.UserControlReportSelections.MarsTool = (int)ReportSettings.ReportSettingsTool.Availability;
            this.UserControlReportSelections.MarsPage = (int)ReportSettings.ReportSettingsPage.ATFleetComparison;
            //Display report selection
            this.UserControlReportSelections.ShowReportSelections();
        }