예제 #1
0
        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;
        }
예제 #2
0
        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();
            }
        }