Exemplo n.º 1
0
 public void UnlockOrLockShift()
 {
     SelectedTerm.Snapshot();//for logging
     SelectedTerm.Locked = !SelectedTerm.Locked;
     NotifyOfPropertyChange(() => SelectedTerm);
     _changedAgents.AddNotContains(SelectedAgent);
     IsDirty = true;
     //BlockConverter.Refresh();
 }
Exemplo n.º 2
0
 public bool IsBelongToSchedule()
 {
     if (SelectedTerm == null || SelectedAgent == null || SelectedTerm.Is <IImmutableTerm>())
     {
         return(false);
     }
     //return !SelectedTerm.GetLowestTerm().IsOutOfBoundary(SelectedTerm.Start, SelectedAgent.Schedule);
     return(true);
 }
Exemplo n.º 3
0
        public void SetAsAbsent(TermStyle type, string kind)
        {
            //SelectedAgent.Schedule.Operator = string.Format("{0}@{1:yyyy/MM/dd HH:mm:ss.fff}", Core.ApplicationCache.Get<string>(Keys.AgentId), DateTime.Now);
            _shiftDispatcherModel.ApplyAbsent(SelectedAgent, SelectedTerm as AssignmentBase, type,
                                              kind == "Fully" ? SelectedTerm.GetLength() : TimeSpan.FromHours(1));
            Refresh(new[] { SelectedAgent }); //also might include rtaa reload

            if (_seatDispatcherPresenter != null)
            {
                _seatDispatcherPresenter.Proc("FastReloadData")();
            }
        }
Exemplo n.º 4
0
 public void RescheduleSeat()
 {
     if (SelectedTerm is AssignmentBase)
     {
         SelectedAgent.Schedule.EmptySeatArrangment <AssignmentBase>(SelectedTerm);
     }
     else
     {
         SelectedTerm.ReleaseSeat();
         SelectedTerm.IsNeedSeat = true;
     }
     SubmitSeatChanges(new[] { SelectedAgent }, true);
 }
Exemplo n.º 5
0
        //public bool CanNavigateToSeatLocation()
        //{
        //    return SelectedTerm != null;
        //}

        //[Preview("CanNavigateToSeatLocation")]
        public void NavigateToSeatLocation()
        {
            if (_selectTermClickCount == 2 && SelectedTerm != null) //double click
            {
                var termHasSeat = SelectedTerm.SeatIsEmpty() ? null : SelectedTerm;
                if (termHasSeat == null)
                {
                    SelectedTerm.DiveInto(t =>
                    {
                        if (!t.SeatIsEmpty())
                        {
                            termHasSeat = t;
                            return(true);
                        }
                        return(false);
                    });
                }
                if (termHasSeat != null)
                {
                    _seatDispatcherPresenter.SaftyInvoke <Core.Reflector>(o => o.Target.SaftyInvoke <IBlockMatrixContainer>(p => p.NavigateTo(termHasSeat.Seat)));
                }
                _selectTermClickCount = 0;
            }
        }