Пример #1
0
        public void PlayWorkingModel(IPlanningContext context, List <EmployeePlanningWeek> listEmployee)
        {
            _listItems.Clear();
            gridControl.DataSource = null;
            if (listEmployee != null && listEmployee.Count > 0)
            {
                WorkingModelManager wmmanager = context.WorkingModels as WorkingModelManager;
                WorkingModelWrapper wrapper   = null;
                foreach (EmployeePlanningWeek week in listEmployee)
                {
                    foreach (EmployeePlanningDay day in week.Days.Values)
                    {
                        if (day.WorkingModels != null)
                        {
                            foreach (EmployeePlanningWorkingModel model in day.WorkingModels)
                            {
                                wrapper = wmmanager[model.WorkingModelID];
                                if (wrapper != null && wrapper.IsContainMessage())
                                {
                                    _listItems.Add(new EmployeeWTItem(
                                                       week.EmployeeId,
                                                       week.FullName,
                                                       day.Date,
                                                       wrapper.Model.Name,
                                                       wrapper.Model.Message
                                                       ));
                                }
                            }
                        }
                    }
                }
            }

            gridControl.DataSource = _listItems;
        }
Пример #2
0
        private void LoadWorkingModels()
        {
            _listmodels.Clear();
            _diction.Clear();
            _dailyModels.Clear();
            _weeklyMessagesModels.Clear();
            _weeklyModels.Clear();

            if (CountryId > 0)
            {
                List <WorkingModel> l = _modelService.GetCountryWorkingModel(CountryId, null, null);

                if (l != null)
                {
                    _listmodels.AddRange(l);
                }

                foreach (WorkingModel wm in _listmodels)
                {
                    WorkingModelWrapper item = new WorkingModelWrapper(wm);
                    _diction[wm.ID] = item;

                    if (item.IsWeekModel)
                    {
                        if (item.IsWeekMessageModel)
                        {
                            _weeklyMessagesModels.Add(item);
                        }
                        else
                        {
                            _weeklyModels.Add(item);
                        }
                    }
                    else
                    {
                        _dailyModels.Add(item);
                    }
                }
            }
        }