Esempio n. 1
0
        // NE PAS UTILISER LE CONTEXT EN STATIC CAR RISQUE D'ECRASEMENT MULTI-SESSIONS UTILISATEURS
        public void CreateOne(Examens examen)
        {
            TPDataBaseEntities context = new TPDataBaseEntities();

            context.Examens.Add(examen);
            context.SaveChanges();
        }
Esempio n. 2
0
 public void UpdateOne(Examens examen)
 {
     TPDataBaseEntities context = new TPDataBaseEntities();
     Examens dbExamen = context.Examens.Find(examen.Id);
     dbExamen.Libelle = examen.Libelle;
     dbExamen.Date = examen.Date;
     context.SaveChanges();
 }
Esempio n. 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Examens examens = db.Examens.Find(id);

            db.Examens.Remove(examens);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
        public void UpdateOne(Examens examen)
        {
            TPDataBaseEntities context  = new TPDataBaseEntities();
            Examens            dbExamen = context.Examens.Find(examen.Id);

            dbExamen.Libelle = examen.Libelle;
            dbExamen.Date    = examen.Date;
            context.SaveChanges();
        }
Esempio n. 5
0
 public ActionResult Edit([Bind(Include = "Id,Libelle,Date")] Examens examens)
 {
     if (ModelState.IsValid)
     {
         db.Entry(examens).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(examens));
 }
Esempio n. 6
0
        public ActionResult Create([Bind(Include = "Id,Libelle,Date")] Examens examens)
        {
            if (ModelState.IsValid)
            {
                db.Examens.Add(examens);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(examens));
        }
Esempio n. 7
0
 public ActionResult Edit([Bind(Include = "Id,PatientId,A,A_Text,B,B_Text,C,C_Text,D,D_Text,E,E_Text,F,F_Text,G,G_Text,H,H_Text,I,I_Text,J,J_Text,Statut")] Examens examens)
 {
     if (ModelState.IsValid)
     {
         db.Entry(examens).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PatientId = new SelectList(db.Patient, "Id", "Nom", examens.PatientId);
     return(View(examens));
 }
Esempio n. 8
0
        public ActionResult Create(Examens examens)
        {
            if (ModelState.IsValid)
            {
                db.Examens.Add(examens);
                db.SaveChanges();
                return(RedirectToAction("Index", "Patients"));
            }

            ViewBag.PatientId = new SelectList(db.Patient, "Id", "Nom", examens.PatientId);
            return(View(examens));
        }
Esempio n. 9
0
        // GET: Examens/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Examens examens = db.Examens.Find(id);

            if (examens == null)
            {
                return(HttpNotFound());
            }
            return(View(examens));
        }
Esempio n. 10
0
        // GET: Examens/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Examens examens = db.Examens.Find(id);

            if (examens == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PatientId = new SelectList(db.Patient, "Id", "Nom", examens.PatientId);
            return(View(examens));
        }
Esempio n. 11
0
        public ActionResult Create(Examens examens)
        {
            if (ModelState.IsValid)
            {
                //Examens evm = new Examens();
                //evm.A = examens.A;
                //evm.B= examens.B;
                //evm.C = examens.C;
                //evm.D = examens.D;
                //evm.E = examens.E;
                //evm.F = examens.F;
                //evm.G = examens.G;
                //evm.H = examens.H;
                //evm.I = examens.I;
                //evm.J = examens.J;
                //evm.A_Text = examens.A_Text;
                //evm.B_Text = examens.B_Text;
                //evm.C_Text = examens.C_Text;
                //evm.D_Text = examens.D_Text;
                //evm.E_Text = examens.E_Text;
                //evm.F_Text = examens.F_Text;
                //evm.G_Text = examens.G_Text;
                //evm.H_Text = examens.H_Text;
                //evm.I_Text = examens.I_Text;
                //evm.J_Text = examens.J_Text;
                //evm.Patient = db.Patient.FirstOrDefault(p => p.Id == examens.PatientId);
                //evm.PatientId = examens.PatientId;
                //evm.Statut = examens.Statut;
                //db.Examens.Add(examens);
                //db.SaveChanges();
                //return RedirectToAction("Index", "Patients");
                db.Examens.Add(examens);
                db.SaveChanges();
                return(RedirectToAction("Index", "Patients"));
            }

            ViewBag.PatientId = new SelectList(db.Patient, "Id", "Nom", examens.PatientId);
            return(View(examens));
        }
Esempio n. 12
0
 // NE PAS UTILISER LE CONTEXT EN STATIC CAR RISQUE D'ECRASEMENT MULTI-SESSIONS UTILISATEURS
 public void CreateOne(Examens examen)
 {
     TPDataBaseEntities context = new TPDataBaseEntities();
     context.Examens.Add(examen);
     context.SaveChanges();
 }