Example #1
0
        private void LoadData()
        {
            // Worlds
            List <StoreToWorld> worldsDataSource;

            if (_storeToWorldIDs == null)
            {
                worldsDataSource = ClientEnvironment.StoreToWorldService.FindAllForStore(_storeID);
            }
            else
            {
                worldsDataSource = ClientEnvironment.StoreToWorldService.FindByIDList(new List <long>(_storeToWorldIDs));
            }

            _planningContext = new TimePlanningReportContext(_countryID, _storeID, _startDate, _endDate);
            List <long> spanIDs = new List <long>();

            foreach (StoreToWorld world in worldsDataSource)
            {
                StoreWorldWeekPlanningState state = _planningContext.GetWorldPlanningState(world.ID);
                if (state.List == null || state.List.Count == 0)
                {
                    spanIDs.Add(world.ID);
                }
                else
                {
                    _bindingHash[world] = state;
                }
            }

            worldsDataSource.RemoveAll(delegate(StoreToWorld stw) { return(spanIDs.Contains(stw.ID)); });
            worldsDataSource.Sort(new WorldComparer());
            DataSource = worldsDataSource;
            //
            // Planning Context
            //


            if (_viewType == ViewType.Weekly)
            {
                _weeklyReportPrintController                = new WeeklyPlanningPrintController(_planningContext);
                _weeklyReportPrintController.ManualFill     = _additionalManual;
                _weeklyReportPrintController.ManualFillOnly = _manualOnly;
                _weeklyReportPrintController.HideSums       = _hideSums;
            }
            field_WorldName.DataBindings.Add("Text", DataSource, "WorldName", Localizer.GetLocalized("World") + ": {0}");
        }
 public WeeklyPlanningPrintController(TimePlanningReportContext planningContext)
 {
     _planningContext = planningContext;
 }
 public WeeklyPlanningPrintController(TimePlanningReportContext planningContext)
 {
     _planningContext = planningContext;
 }
        private void LoadData()
        {
            // Worlds
            List<StoreToWorld> worldsDataSource;
            if (_storeToWorldIDs == null)
            {
                worldsDataSource = ClientEnvironment.StoreToWorldService.FindAllForStore(_storeID);
            }
            else
            {
                worldsDataSource = ClientEnvironment.StoreToWorldService.FindByIDList(new List<long>(_storeToWorldIDs));
            }

            _planningContext = new TimePlanningReportContext(_countryID, _storeID, _startDate, _endDate);
            List<long> spanIDs = new List<long>();
            foreach (StoreToWorld world in worldsDataSource)
            {
                StoreWorldWeekPlanningState state = _planningContext.GetWorldPlanningState(world.ID);
                if (state.List == null || state.List.Count == 0)
                    spanIDs.Add(world.ID);
                else
                    _bindingHash[world] = state;
            }

            worldsDataSource.RemoveAll(delegate(StoreToWorld stw) { return spanIDs.Contains(stw.ID); });
            worldsDataSource.Sort(new WorldComparer());
            DataSource = worldsDataSource;
            //
            // Planning Context
            //

            if (_viewType == ViewType.Weekly)
            {
                _weeklyReportPrintController = new WeeklyPlanningPrintController(_planningContext);
                _weeklyReportPrintController.ManualFill = _additionalManual;
                _weeklyReportPrintController.ManualFillOnly = _manualOnly;
                _weeklyReportPrintController.HideSums = _hideSums;
            }
            field_WorldName.DataBindings.Add("Text", DataSource, "WorldName", Localizer.GetLocalized("World") + ": {0}");
        }