public void Init() { dateNaissance = DateTime.Now; EntityConnection connection = Effort.EntityConnectionFactory.CreateTransient("name=ReaPlanDBEntities"); context = new ReaPlanDBEntities(connection); //creation d'un patient test dans la fausse BD PatientDB patient = PatientDB.CreatePatientDB("pat", "paul", dateNaissance, "M", (decimal)172, (decimal)66, 123, 26); context.AddToPatientDBs(patient); context.SaveChanges(); PatientData.conn = connection; }
public static void InscriptionPatient(Patient pat) { if (conn == null) { context = new ReaPlanDBEntities(); pat.CreeDossier(); } else { context = new ReaPlanDBEntities(conn); } using (context) { PatientDB patient = PatientDB.CreatePatientDB(pat.Nom, pat.Prenom, pat.DateNaiss, pat.Sexe, (decimal)pat.Taille, (decimal)pat.Poid, pat.ID1, pat.ID2); context.AddToPatientDBs(patient); context.SaveChanges(); } }