public ActionResult DeleteConfirmed(int id) { RemedyTable remedytable = db.RemedyTables.Find(id); db.RemedyTables.Remove(remedytable); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,Remedy,Definition,date,cattype,Causes,Prevention")] RemedyTable remedytable) { if (ModelState.IsValid) { db.Entry(remedytable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(remedytable)); }
public ActionResult Create([Bind(Include = "id,Remedy,Definition,date,cattype,Causes,Prevention")] RemedyTable remedytable) { if (ModelState.IsValid) { remedytable.date = DateTime.Now; db.RemedyTables.Add(remedytable); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(remedytable)); }
// GET: /Adremedy/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RemedyTable remedytable = db.RemedyTables.Find(id); if (remedytable == null) { return(HttpNotFound()); } return(View(remedytable)); }
// GET: /Adremedy/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RemedyTable remedytable = db.RemedyTables.Find(id); if (remedytable == null) { return(HttpNotFound()); } var allcat = (from e in db.DocCategories select e).ToList(); var getcatname = (from e in db.DocCategories where e.id == remedytable.cattype select e).FirstOrDefault(); ViewBag.catname = getcatname; ViewBag.cat = allcat; return(View(remedytable)); }