Beispiel #1
0
 public Menu()
 {
     _doctorDataAccess                = new DoctorDataAccess();
     _patientDataAccess               = new PatientDataAccess();
     _timetableDataAccess             = new TimetableDataAccess();
     _doctorsSpecializationDataAccess = new DoctorsSpecializationDataAccess();
 }
        public void SaveTimetable()
        {
            var newTimetable = new TimetableModel();

            newTimetable.TimetableDescription  = TimetableDescription;
            newTimetable.TimetableName         = TimetableName;
            newTimetable.TimetableAbbreviation = TimetableAbbreviation;
            newTimetable.RouteId          = RouteId;
            newTimetable.IsMultiDirection = IsMultiDirection;
            if (IsMultiDirection)
            {
                newTimetable.ServiceDirectionId = -1;
            }
            else
            {
                newTimetable.ServiceDirectionId = ServiceDirectionId;
            }
            if (TimetableId <= 0)
            {
                TimetableDataAccess.InsertTimetableForRoute(newTimetable);
            }
            else
            {
                newTimetable.Id = TimetableId;
                TimetableDataAccess.UpdateTimetable(newTimetable);
            }
            ClearTimetable();
            TimetablesUI.TimetableList = new BindableCollection <TimetableModel>(TimetableDataAccess.GetAllTimetablesPerRoute(RouteId));
            NotifyOfPropertyChange(() => TimetablesUI);
        }
 public void DeleteTimetable()
 {
     TimetableDataAccess.DeleteTimetable(SelectedTimetable.Id);
     ServiceSourceList.Clear();
     ServiceDestinationList.Clear();
     TimetablesUI.TimetableList.Remove(SelectedTimetable);
     TimetableId = 0;
 }
        protected override async void OnViewLoaded(object view)
        {
            base.OnViewLoaded(view);
            RouteModel rm = RouteDataAccess.GetRouteById(RouteId);

            TimetablesUI.RouteName = rm.RouteName;
            RouteId = rm.Id;
            TimetablesUI.TimetableList = new BindableCollection <TimetableModel>(TimetableDataAccess.GetAllTimetablesPerRoute(RouteId));
            ServiceDirectionList       = new BindableCollection <ServiceDirectionModel>(ServiceDirectionDataAccess.GetAllServiceDirectionsPerRoute(RouteId));
            NotifyOfPropertyChange(() => TimetablesUI);
        }
        public ScottPlotGraph(int timetableId)
        {
            TimetableId = timetableId;
            Timetable   = TimetableDataAccess.GetTimetableById(TimetableId);

            LocationList = new ObservableCollection <LocationModel>(LocationDataAccess.GetAllLocationsPerRoute(Timetable.RouteId)
                                                                    .OrderBy(x => x.Order)
                                                                    .ToList());
            int i = 0;

            foreach (var item in LocationList)
            {
                item.Order = i++;
            }
            OnPropertyChanged("LocationList");
            PrepareDataSet();
        }
        protected override void OnViewLoaded(object view)
        {
            base.OnViewLoaded(view);
            Timetable    = TimetableDataAccess.GetTimetableById(TimetableId);
            LocationList =
                new BindableCollection <LocationModel>(
                    LocationDataAccess.GetAllLocationsPerRoute(Timetable.RouteId)
                    .OrderBy(x => x.Order)
                    .ToList());
            int i = 0;

            foreach (var item in LocationList)
            {
                item.Order = i++;
            }


            SetPeriod();             // sets start and end time at the graph
            Dummy += 1;
            LocationList.Refresh();
            PrepareDataSet();
            TimeGraphUIChanged++;
            TimeGraphUI.Refresh();
        }
 protected override async void OnViewLoaded(object view)
 {
     base.OnViewLoaded(view);
     TimetableList = new BindableCollection <TimetableRouteModel>(TimetableDataAccess.GetAllTimetables());
     NotifyOfPropertyChange(() => TimetableList);
 }