public void DeletePatient() { try { PatientV = PatientM.GetPatient(PatientSelected); PatientM.DeletePatient(PatientV); PatientIds.Remove(PatientV.PatientId); (App.Current as App).navigation.MainWindows.comments.Text = " המטופל הוסר בהצלחה מהמערכת"; } catch (Exception e) { (App.Current as App).navigation.MainWindows.comments.Text = e.Message.ToString(); } }
public void AddPatient() { try { if (Id == null || Fname == null || Lname == null || PhoneNum == null || MailAddress == null) { throw new ArgumentException("אתה צריך למלא את כל השדות"); } else { PatientV = new Patient(Id, Fname, Lname, PhoneNum, DateOfBirth, MailAddress); PatientM.AddPatient(PatientV); PatientM.SendMail(PatientV); PatientIds.Add(PatientV.PatientId); (App.Current as App).navigation.MainWindows.comments.Text = "המטופל נוסף בהצלחה"; } } catch (Exception e) { (App.Current as App).navigation.MainWindows.comments.Text = e.Message.ToString(); } }
public bool Any() => PatientIds.Any();