Beispiel #1
0
 protected void SetTermStart(Term term, TimeBox timeBox)
 {
     _termStartAlterOffSet = NewStartTime.Subtract(term.Start);
     //term.Start = NewStartTime;
     //timeBox.SetTime(term, NewStartTime, term.End, (t, success) =>
     //                                             {
     //                                                 _setTimeCallBack(term, "", success);
     //                                             } ,false);
 }
 public void Clear()
 {
     NewStartDate.Clear();
     NewStartTime.Clear();
     NewEndDate.Clear();
     NewEndTime.Clear();
     NewStartDateTime  = null;
     MoveTimeSpan      = 0;
     RecurrencePattern = null;
 }
Beispiel #3
0
        public DomainEvent GetDomainEvent()
        {
            switch (DomainEventType)
            {
            case EventType.Added:
            {
                return(new AppointmentAdded(AggregateId.GetAggregateIdentifier(),
                                            AggregateVersion,
                                            UserId,
                                            new Tuple <Date, Time>(TimeStampDate.GetDate(), TimeStampTime.GetTime()),
                                            ActionTag,
                                            PatientId,
                                            Description,
                                            StartTime.GetTime(),
                                            EndTime.GetTime(),
                                            TherapyPlaceId.Value,
                                            LabelId.Value,
                                            AppointmentId.Value));
            }

            case EventType.Replaced:
            {
                return(new AppointmentReplaced(AggregateId.GetAggregateIdentifier(),
                                               AggregateVersion,
                                               UserId,
                                               PatientId,
                                               new Tuple <Date, Time>(TimeStampDate.GetDate(), TimeStampTime.GetTime()),
                                               ActionTag,
                                               NewDescription,
                                               NewDate.GetDate(),
                                               NewStartTime.GetTime(),
                                               NewEndTime.GetTime(),
                                               NewTherapyPlaceId.Value,
                                               NewLabelId.Value,
                                               OriginalAppointmendId.Value));
            }

            case EventType.Removed:
            {
                return(new AppointmentDeleted(AggregateId.GetAggregateIdentifier(),
                                              AggregateVersion,
                                              UserId,
                                              PatientId,
                                              new Tuple <Date, Time>(TimeStampDate.GetDate(), TimeStampTime.GetTime()),
                                              ActionTag,
                                              RemovedAppointmentId.Value));
            }
            }
            throw new Exception("inner error");
        }
Beispiel #4
0
 /*
  * The method randomizes the sequence textboxes.
  * New start time: (current simulation time) + (random amount of minutes between 5 and 120)
  * New end time: (New start time) + (random amount of minutes between 5 and 120)
  * New room and activity: random selection from database where the new room and activity are compatible with each other
  */
 public void RandomizeSequence()
 {
     try
     {
         int randomIndex;
         NewStartTime = CurrentTime.AddMinutes(rnd.Next(5, 120));
         NewEndTime   = NewStartTime.AddMinutes(rnd.Next(5, 120));
         List <DataTypes> RoomActivityList = new List <DataTypes>();
         RoomActivityList = dbHandler.GetRoomActivityCombo();
         randomIndex      = rnd.Next(RoomActivityList.Count);
         NewRoom          = RoomActivityList[randomIndex].Room;
         NewActivity      = RoomActivityList[randomIndex].Activity;
     }
     catch (ArgumentOutOfRangeException)
     {
         ActivityViewModel.ShowMessageBox("Simulator must be running", "Error");
     }
 }
        private void EditQueueAction()
        {
            var queue = Queues.FirstOrDefault(i => i.Id.ToString() == SelectedItem.Id.ToString());

            if (queue != null)
            {
                queue.Name = SelectedItem.Name;
                if (!SelectedItem.IsStartLoadAt)
                {
                    NewStartTime = TimeSpan.Zero;
                }
                if (!SelectedItem.IsStopLoadAt)
                {
                    NewStopTime = TimeSpan.Zero;
                }
                queue.IsStartLoadAt = SelectedItem.IsStartLoadAt;
                queue.StartDownload = NewStartTime.ToString();
                queue.IsStopLoadAt  = SelectedItem.IsStopLoadAt;
                queue.StopDownload  = NewStopTime.ToString();
            }
            dataStorage.Save(Queues);
        }