public static ServicePatient.Patient GetPatient(int idPatient) { try { ServicePatientManager s = new ServicePatientManager(); return s.GetPatient(idPatient); } catch (EndpointNotFoundException e) { MessageBox.Show("Le serveur ne répond pas.", "Erreur"); throw e; } }
public async static Task<ServicePatient.Patient[]> GetListPatientAsync() { try { ServicePatientManager s = new ServicePatientManager(); return await s.GetListPatientAsync(); } catch (EndpointNotFoundException e) { MessageBox.Show("Le serveur ne répond pas.", "Erreur"); throw e; } }
public static bool AddPatient(string firstname, string name, DateTime birthday) { try { ServicePatientManager s = new ServicePatientManager(); ServicePatient.Patient p = new ServicePatient.Patient(); p.Firstname = firstname; p.Name = name; p.Birthday = birthday; p.Observations = new ServicePatient.Observation[0]; return s.AddPatient(p); } catch (EndpointNotFoundException e) { MessageBox.Show("Le serveur ne répond pas.", "Erreur"); throw e; } }