public bool Authenticate(string inUsername, string inPassword) { var employee = ((IEmployeeRepository)repository).GetByUsernameAndPassword(inUsername, inPassword); if (employee != null) { LoggedIn.Initialize(employee); return(true); } else { return(false); } }
public MedicalExamination Add(Patient inPatient, ExaminationType inExaminationType, bool isEmergency) { var employee = LoggedIn.GetEmployee(); MedicalExamination medicalExamination; if (employee is Doctor) { medicalExamination = new MedicalExamination(LoggedIn.GetWaitingRoom(), (Doctor)employee, inPatient, DateTime.Now, inExaminationType); } else { medicalExamination = new MedicalExamination(LoggedIn.GetWaitingRoom(), LoggedIn.GetWaitingRoom().Doctor, inPatient, DateTime.Now, inExaminationType); } repository.Add(medicalExamination); return(medicalExamination); }
public void Logout() { LoggedIn.Logout(); }