public ActionResult Create([Bind(Include = "TreatmentID,Title,Treament_Description")] Treatment treatment) { if (ModelState.IsValid) { db.Treatment.Add(treatment); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(treatment)); }
public ActionResult Create([Bind(Include = "PhysicianID,LastName,FirstMidName,Age")] Physician physician) { if (ModelState.IsValid) { db.Physician.Add(physician); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(physician)); }
public ActionResult Create([Bind(Include = "Patient_TreatmentID,TreatmentID,PhysicianID,Patient_Treatment_Date")] Patient_Treatment patient_Treatment) { if (ModelState.IsValid) { db.Patient_Treatment.Add(patient_Treatment); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PhysicianID = new SelectList(db.Physician, "PhysicianID", "LastName", patient_Treatment.PhysicianID); ViewBag.TreatmentID = new SelectList(db.Treatment, "TreatmentID", "Title", patient_Treatment.TreatmentID); return(View(patient_Treatment)); }
public ActionResult Create(Patient patient, int DoctorId) { _db.Patients.Add(patient); if (DoctorId != 0) { _db.DoctorPatient.Add(new DoctorPatient() { DoctorId = DoctorId, PatientId = patient.PatientId }); } _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(Doctor doctor) { _db.Doctors.Add(doctor); _db.SaveChanges(); return(RedirectToAction("Index")); }