Ejemplo n.º 1
0
        public void AutoFill()
        {
            ServiceName         = ServiceTemplate.ServiceTemplateName;
            ServiceAbbreviation = ServiceTemplate.ServiceTemplateAbbreviation;
            int StartTime = TimeConverters.TimeToMinutes(StartTimeText);

            EndTimeText = TimeConverters.MinutesToString(StartTime + ServiceTemplate.CalculatedDuration);
            NotifyOfPropertyChange(() => CanSaveService);
        }
Ejemplo n.º 2
0
 public void EditService()
 {
     ServiceName         = SelectedService.ServiceName;
     ServiceAbbreviation = SelectedService.ServiceAbbreviation;
     ServiceTemplate     = ServiceTemplateDataAccess.GetServiceTemplateById(SelectedService.ServiceTemplateId);
     ServiceId           = SelectedService.Id;
     StartTimeText       = TimeConverters.MinutesToString(SelectedService.StartTime);
     EndTimeText         = TimeConverters.MinutesToString(SelectedService.EndTime);
     NotifyOfPropertyChange(() => CanEditService);
     NotifyOfPropertyChange(() => CanSaveService);
     NotifyOfPropertyChange(() => CanRepeat);
 }
Ejemplo n.º 3
0
        private void PrepareDataSet()
        {
            TimeGraphUI      = new ObservableCollection <TimeGraphUIModel>();
            ServiceClassList = ServiceClassDataAccess.GetAllServiceClasses();
            var serviceList = new ObservableCollection <ServiceModel>(ServicesDataAccess.GetServicesPerTimetable(TimetableId));

            foreach (var service in serviceList)
            {
                var item = new TimeGraphUIModel();
                var serviceTemplateId = service.ServiceTemplateId;
                var serviceTemplate   = ServiceTemplateDataAccess.GetServiceTemplateById(serviceTemplateId);
                item.TimeEventList       = new BindableCollection <ExtendedFullTimeEventModel>(FullTimeEventDataAccess.GetAllExtendedFullTimeEventsPerServiceTemplate(serviceTemplateId));
                item.ServiceName         = service.ServiceName;
                item.ServiceAbbreviation = service.ServiceAbbreviation;
                item.ServiceType         = serviceTemplate.ServiceType;
                item.StartTimeText       = service.StartTimeText;
                item.EndTimeText         = service.EndTimeText;
                int actualTime = service.StartTime;
                foreach (var fullTimeEvent in item.TimeEventList)
                {
                    actualTime += fullTimeEvent.ArrivalTime;
                    fullTimeEvent.ArrivalTimeText = TimeConverters.MinutesToString(actualTime);
                    DataPoint point = GetFirstDataPoint(fullTimeEvent, actualTime);
                    item.DataLine.Add(point);
                    if (fullTimeEvent.WaitTime > 0)
                    {
                        actualTime += fullTimeEvent.WaitTime;
                        DataPoint point2 = GetSecondDataPoint(actualTime, point.X);
                        item.DataLine.Add(point2);
                    }
                    fullTimeEvent.DepartureTimeText = TimeConverters.MinutesToString(actualTime);
                }
                TimeGraphUI.Add(item);
            }
            OnPropertyChanged("TimeGraphUI");
        }