public void SetNewTime(RoutedEventArgs e) { var source = new Luna.Core.Reflector(e.OriginalSource); var newPlacement = source.Property <ITerm>("DropedPlacement"); var agent = BindableAgents[source.Property <int>("PointOutDataRowIndex")]; var pointOutBlock = source.Property <ITerm>("PointOutBlock"); var newStart = newPlacement.Start; var newEnd = newPlacement.End; if ((pointOutBlock.Start == newStart && pointOutBlock.End == newEnd)) { return; } pointOutBlock.SaftyInvoke <Term>(x => { if (!x.Locked) { agent.SaftyInvoke <IAgent>(o => o.Schedule.SetTime(x, newStart, newEnd, (t, success) => { if (success) { x.Tag = _alterComments; IsDirty = true; } o.OperationFail = !success; }, false) ); } }); }
public bool Ask(RoutedEventArgs e, IQuestionPresenter p) { var source = new Luna.Core.Reflector(e.OriginalSource); var newPlacement = source.Property <ITerm>("DropedPlacement"); var agent = (IAgent)BindableAgents[source.Property <int>("PointOutDataRowIndex")]; var pointOutBlock = source.Property <ITerm>("PointOutBlock"); var newStart = newPlacement.Start; var newEnd = newPlacement.End; if (pointOutBlock.Start == newStart && pointOutBlock.End == newEnd) { return(false); } p.DisplayName = LanguageReader.GetValue("Shifts_ShiftDispatcher_AskEditShift"); p.Editable = true; pointOutBlock.SaftyInvoke <Term>(x => { p.Text = string.Format(LanguageReader.GetValue("Shifts_ShiftDispatcher_AskEditShiftText"), agent.Profile.Name, x.Start, x.Text); p.Comments = x.Tag; }); return(true); }
private void InvokerPropertyChanged(object sender, PropertyChangedEventArgs e) { var invoker = new Luna.Core.Reflector(sender); if (e.PropertyName == "AgentAdherences" && invoker.Property <IList <IEnumerable> >("AgentAdherences").Count > 0) { //if (invoker.Property<bool>("RtaaIsAutoRunning")) return; Refresh(); } if (e.PropertyName == "EnableRtaa" && sender.SaftyGetProperty <bool, IShiftDispatcherPresenter>(p => p.EnableRtaa == false)) { this.Close(); sender.SaftyInvoke <INotifyPropertyChanged>(p => p.PropertyChanged -= InvokerPropertyChanged); } }
private void InvokerPropertyChanged(object sender, PropertyChangedEventArgs e) { var invoker = new Luna.Core.Reflector(sender); if (e.PropertyName == "AgentAdherences" && invoker.Property<IList<IEnumerable>>("AgentAdherences").Count > 0) { //if (invoker.Property<bool>("RtaaIsAutoRunning")) return; Refresh(); } if (e.PropertyName == "EnableRtaa" && sender.SaftyGetProperty<bool, IShiftDispatcherPresenter>(p => p.EnableRtaa == false)) { this.Close(); sender.SaftyInvoke<INotifyPropertyChanged>(p => p.PropertyChanged -= InvokerPropertyChanged); } }
public void SetNewTime(RoutedEventArgs e) { var source = new Luna.Core.Reflector(e.OriginalSource); var newPlacement = source.Property<ITerm>("DropedPlacement"); var agent = BindableAgents[source.Property<int>("PointOutDataRowIndex")]; var pointOutBlock = source.Property<ITerm>("PointOutBlock"); var newStart = newPlacement.Start; var newEnd = newPlacement.End; if ((pointOutBlock.Start == newStart && pointOutBlock.End == newEnd)) return; pointOutBlock.SaftyInvoke<Term>(x => { if (!x.Locked) agent.SaftyInvoke<IAgent>(o=> o.Schedule.SetTime(x, newStart, newEnd, (t, success) => { if (success) { x.Tag = _alterComments; IsDirty = true; } o.OperationFail = !success; }, false) ); }); }
public bool Ask(RoutedEventArgs e, IQuestionPresenter p) { var source = new Luna.Core.Reflector(e.OriginalSource); var newPlacement = source.Property<ITerm>("DropedPlacement"); var agent = (IAgent)BindableAgents[source.Property<int>("PointOutDataRowIndex")]; var pointOutBlock = source.Property<ITerm>("PointOutBlock"); var newStart = newPlacement.Start; var newEnd = newPlacement.End; if (pointOutBlock.Start == newStart && pointOutBlock.End == newEnd) return false; p.DisplayName = LanguageReader.GetValue("Shifts_ShiftDispatcher_AskEditShift"); p.Editable = true; pointOutBlock.SaftyInvoke<Term>(x => { p.Text = string.Format(LanguageReader.GetValue("Shifts_ShiftDispatcher_AskEditShiftText"), agent.Profile.Name, x.Start, x.Text); p.Comments = x.Tag; }); return true; }