Пример #1
0
        public NewDocViewModel(HeadPhysician sessionDoctor)
        {
            try
            {
                ((IDatabaseCommutable)sessionDoctor).LoadFromDb(sessionDoctor.Id);
            }
            catch (KeyNotFoundException)
            {
                ErrorWindow errorWindow = new ErrorWindow("A database error occured");
                errorWindow.ShowDialog();
            }
            catch (HaveBeenFiredException e)
            {
                ErrorWindow errorWindow = new ErrorWindow(e);
                errorWindow.ShowDialog();
            }

            CurrentDoc = sessionDoctor;
        }
Пример #2
0
        public MeViewModel(Nurse sessionDoctor)
        {
            // LOAD AGAIN TO UPDATE IF SMTH CHANGED; (WE GONNA CALL SOME ERRORS BEEEACH)
            try
            {
                ((IDatabaseCommutable)sessionDoctor).LoadFromDb(sessionDoctor.Id);
            }
            catch (KeyNotFoundException)
            {
                ErrorWindow errorWindow = new ErrorWindow("A database error occured");
                errorWindow.ShowDialog();
            }
            catch (HaveBeenFiredException e)
            {
                ErrorWindow errorWindow = new ErrorWindow(e);
                errorWindow.ShowDialog();
            }

            CurrentDoc = sessionDoctor;
        }
Пример #3
0
        public DoctorsViewModel(Nurse sessionDoctor)
        {
            try
            {
                ((IDatabaseCommutable)sessionDoctor).LoadFromDb(sessionDoctor.Id);
            }
            catch (KeyNotFoundException)
            {
                ErrorWindow errorWindow = new ErrorWindow("A database error occured");
                errorWindow.ShowDialog();
            }
            catch (HaveBeenFiredException e)
            {
                ErrorWindow errorWindow = new ErrorWindow(e);
                errorWindow.ShowDialog();
            }

            CurrentDoc = sessionDoctor;

            AllDoctors    = PatientLoader.LoadDoctors();
            AllNurses     = PatientLoader.LoadNurses();
            AllHeadPhyses = PatientLoader.LoadHeadPhyses();
        }