public ActionResult DeleteConfirmed(int id) { MedicalHistoryQuestion medicalHistoryQuestion = db.MedicalHistoryQuestions.Find(id); db.MedicalHistoryQuestions.Remove(medicalHistoryQuestion); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,MedicalHistoryQuestionName,BranchId,UserId,TimeAdded")] MedicalHistoryQuestion medicalHistoryQuestion) { if (ModelState.IsValid) { db.Entry(medicalHistoryQuestion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(medicalHistoryQuestion)); }
// GET: MedicalHistoryQuestions/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MedicalHistoryQuestion medicalHistoryQuestion = db.MedicalHistoryQuestions.Find(id); if (medicalHistoryQuestion == null) { return(HttpNotFound()); } return(View(medicalHistoryQuestion)); }
public ActionResult Create([Bind(Include = "Id,MedicalHistoryQuestionName")] MedicalHistoryQuestion medicalHistoryQuestion) { if (ModelState.IsValid) { medicalHistoryQuestion.BranchId = (int)Session["UserBranchId"]; medicalHistoryQuestion.UserId = int.Parse(Session["UserId"].ToString()); medicalHistoryQuestion.TimeAdded = DateTime.Now; db.MedicalHistoryQuestions.Add(medicalHistoryQuestion); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(medicalHistoryQuestion)); }