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; }
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; }
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(); }