示例#1
0
        public ActionResult MedicalPrescriptionEdit(int id, medicalPrescription medicalPrescription)
        {
            db.Entry(medicalPrescription).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            Appointment   a = db.Appointments.Where(u => u.idmedicalPrescription == id).FirstOrDefault();
            Patient       p = db.Patients.Find(a.cardNumber);
            medicalRecord m = db.medicalRecords.Find(p.idmedicalRecords);

            m.previousDiseases = m.previousDiseases + ", " + medicalPrescription.Diagnostic;
            m.date             = a.Date;
            db.Entry(m).State  = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            TempData["Success"] = "Changes successfully applied to your Medical Prescription!";
            return(RedirectToAction("AppointmentIndex", "Appointment"));
        }
 public ActionResult MedicalRecordEdit(int id, medicalRecord medicalRecord)
 {
     db.Entry(medicalRecord).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     TempData["Success"] = "Changes successfully applied to your Medical Record!";
     return(RedirectToAction("PatientIndex", "Patient"));
 }
示例#3
0
 public ActionResult PatientEdit(string id, Patient patient)
 {
     db.Entry(patient).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     TempData["Success"] = "Changes successfully applied to the patient!";
     return(RedirectToAction("PatientIndex"));
 }
示例#4
0
 public ActionResult MedicEdit(int id, Medic medic)
 {
     db.Entry(medic).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     TempData["Success"] = "Changes successfully applied to this Medic!";
     return(RedirectToAction("MedicIndex"));
 }
 public ActionResult AppointmentEdit(int id, Appointment appointment)
 {
     db.Entry(appointment).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     TempData["Success"] = "Changes successfully applied to your appointment!";
     return(RedirectToAction("AppointmentIndex"));
 }
示例#6
0
        public Categoria Put([FromBody] Categoria cat)
        {
            _context.Entry <Categoria>(cat).State = EntityState.Modified;
            _context.SaveChanges();

            return(cat);
        }
        public ActionResult EditAssistant(int id, Assistant assistant)
        {
            try
            {
                db.Entry(assistant).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                TempData["Success"] = "Changes successfully applied to the assistant!";


                return(RedirectToAction("IndexAssistant"));
            }
            catch
            {
                return(View());
            }
        }