示例#1
0
 public ShiftImportPresenter(IShiftDispatcherModel shiftDispatcherModel, ICalendarEventModel calendarEventModel, IOpenFileService openFileService)
 {
     _shiftDispatcherModel    = shiftDispatcherModel;
     _calendarEventModel      = calendarEventModel;
     _openFileService         = openFileService;
     _bindableAgents          = new List <IEnumerable>();
     _openFileService.Filter  = "Excel File|*.xls";
     _assignmentCellConverter = new BlockToCellConverter(Brushes.OrangeRed, "#FF77BB44".ToBrush(1), Brushes.DarkGray).ShowDayOffText(false);
 }
示例#2
0
 public ShiftImportPresenter(IShiftDispatcherModel shiftDispatcherModel, ICalendarEventModel calendarEventModel, IOpenFileService openFileService)
 {
     _shiftDispatcherModel = shiftDispatcherModel;
     _calendarEventModel = calendarEventModel;
     _openFileService = openFileService;
     _bindableAgents = new List<IEnumerable>();
     _openFileService.Filter = "Excel File|*.xls";
     _assignmentCellConverter = new BlockToCellConverter(Brushes.OrangeRed, "#FF77BB44".ToBrush(1), Brushes.DarkGray).ShowDayOffText(false);
 }
示例#3
0
        private readonly AutoResetEvent _autoReset = new AutoResetEvent(false);//异步调用,等待RegisterRunStaffingChart完成后再执行OnInitialize中Thread内容

        public ShiftComposerPresenter(IShiftDispatcherModel shiftDispatcherModel, ILaborHoursCountingModel laborHoursCountingModel, ICalendarEventModel calendarEventModel)
        {
            _shiftDispatcherModel    = shiftDispatcherModel;
            _laborHoursCountingModel = laborHoursCountingModel;
            _calendarEventModel      = calendarEventModel;

            //x_changedTerms = new List<Tuple<int, DateTerm>>();
            //x_changedCells = new List<Tuple<int, DateTerm>>();

            //x_assignmentInsertRuleIntersectionPoints = new Dictionary<AssignmentType, IList<Luna.Core.Tuple<int, int>>>();
            //x_assignmentContributionPositions = new Dictionary<AssignmentType, bool[]>();

            //InitializeCommandBindings
            var shiftPainterCommandBinding = new CommandBinding(Luna.WPF.ApplicationFramework.ApplicationCommands.ShiftPainter, CopyShiftForPainting, (sender, e) =>
            {
                e.CanExecute = InitalDrawBlock != null && CellMode && SelectionTimeRange != null;
                e.Parameter.SaftyInvoke <ICheckableCommandParameter>(p =>
                {
                    p.Handled   = true;
                    p.IsChecked = PaintShiftIsEnabled;
                });
            });
            var saveCommandBinding = new AsyncCommandBinding(ApplicationCommands.Save,
                                                             (sender, e) => SubmitChanges(false),
                                                             (sender, e) => e.CanExecute = CellChanged,
                                                             (sender, e) =>
            {
                if (e.Error == null)
                {
                    return;
                }
                CellChanged = true;
                throw e.Error;
            });

            var undoCommandBinding = new CommandBinding(ApplicationCommands.Undo, (sender, e) => SubmitChanges(true), (sender, e) => e.CanExecute = CellChanged);

            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SetDayOff,
                                                   (sender, e) =>
            {
                SetAsDayOff();
            }));
            CommandBindings.Add(shiftPainterCommandBinding);
            CommandBindings.Add(saveCommandBinding);
            CommandBindings.Add(undoCommandBinding);
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.EstimateShift, EstimateShift, AnalyisComplete));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.ShowEstimateShift, SendParameter, AnalyisComplete));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.OpenStaffingStatistic, SendParameter));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.OpenCompositiveServiceQueue, SendParameter, AnalyisComplete));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SortByTermStart, delegate { Sort(); }));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SwitchView, SwitchView));

            ResetAlterDateRange();
        }
 public CalendarEventImportPresenter(Country country, IOpenFileService openFileService, ICalendarEventModel calendarEventModel)
     : base(openFileService)
 {
     _country            = country;
     _calendarEventModel = calendarEventModel;
     _nameOfSheets       = new Dictionary <string, string[]>
     {
         { "calendarevent", new[] { "EventName", "StartDate", "EndDate", "TimeZoneId" } }
     };
     _existEntities  = new List <CalendarEvent>();
     _loadedEntities = new List <ConflictCalendarEvent>(100);
     _hasConflict    = false;
 }
示例#5
0
        private readonly AutoResetEvent _autoReset = new AutoResetEvent(false);//异步调用,等待RegisterRunStaffingChart完成后再执行OnInitialize中Thread内容

        public ShiftComposerPresenter(IShiftDispatcherModel shiftDispatcherModel, ILaborHoursCountingModel laborHoursCountingModel, ICalendarEventModel calendarEventModel)
        {
            _shiftDispatcherModel = shiftDispatcherModel;
            _laborHoursCountingModel = laborHoursCountingModel;
            _calendarEventModel = calendarEventModel;

            //x_changedTerms = new List<Tuple<int, DateTerm>>();
            //x_changedCells = new List<Tuple<int, DateTerm>>();

            //x_assignmentInsertRuleIntersectionPoints = new Dictionary<AssignmentType, IList<Luna.Core.Tuple<int, int>>>();
            //x_assignmentContributionPositions = new Dictionary<AssignmentType, bool[]>();

            //InitializeCommandBindings
            var shiftPainterCommandBinding = new CommandBinding(Luna.WPF.ApplicationFramework.ApplicationCommands.ShiftPainter, CopyShiftForPainting, (sender, e) =>
            {
                e.CanExecute = InitalDrawBlock != null && CellMode && SelectionTimeRange != null;
                e.Parameter.SaftyInvoke<ICheckableCommandParameter>(p =>
                {
                    p.Handled = true;
                    p.IsChecked = PaintShiftIsEnabled;
                });
            });
            var saveCommandBinding = new AsyncCommandBinding(ApplicationCommands.Save,
                                                             (sender, e) => SubmitChanges(false),
                                                             (sender, e) => e.CanExecute = CellChanged,
                                                             (sender, e) =>
                                                             {
                                                                 if (e.Error == null) return;
                                                                 CellChanged = true;
                                                                 throw e.Error;
                                                             });

            var undoCommandBinding = new CommandBinding(ApplicationCommands.Undo, (sender, e) => SubmitChanges(true), (sender, e) => e.CanExecute = CellChanged);
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SetDayOff,
                                                   (sender, e) =>
                                                       {
                                                           SetAsDayOff();
                                                       }));
            CommandBindings.Add(shiftPainterCommandBinding);
            CommandBindings.Add(saveCommandBinding);
            CommandBindings.Add(undoCommandBinding);
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.EstimateShift, EstimateShift, AnalyisComplete));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.ShowEstimateShift, SendParameter, AnalyisComplete));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.OpenStaffingStatistic, SendParameter));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.OpenCompositiveServiceQueue, SendParameter, AnalyisComplete));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SortByTermStart, delegate { Sort(); }));
            CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SwitchView, SwitchView));

            ResetAlterDateRange();
        }
示例#6
0
 public CalendarEventPresenter(ICalendarEventModel model)
 {
     _model = model;
     _dayItemsSource = new Dictionary<DateTime, DayItemModel>(10 * 12);
     _activeTime = DateTime.Today;
 }
示例#7
0
 public CalendarEventPresenter(ICalendarEventModel model)
 {
     _model          = model;
     _dayItemsSource = new Dictionary <DateTime, DayItemModel>(10 * 12);
     _activeTime     = DateTime.Today;
 }