public ActionResult DeleteConfirmed(int id) { Service_Area_Contents service_Area_Contents = db.Service_Area_Contents.Find(id); db.Service_Area_Contents.Remove(service_Area_Contents); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "service_contents_id,service_contents_title,service_contents_content,service_contents_icon")] Service_Area_Contents service_Area_Contents) { if (ModelState.IsValid) { db.Entry(service_Area_Contents).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(service_Area_Contents)); }
public ActionResult Create([Bind(Include = "service_contents_id,service_contents_title,service_contents_content,service_contents_icon")] Service_Area_Contents service_Area_Contents) { if (ModelState.IsValid) { db.Service_Area_Contents.Add(service_Area_Contents); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(service_Area_Contents)); }
public ActionResult DeleteConfirmed(int id) { if (!Check_Admin()) { return(RedirectToAction("Index", "Login")); } Service_Area_Contents service_Area_Contents = db.Service_Area_Contents.Find(id); db.Service_Area_Contents.Remove(service_Area_Contents); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Service_Area_Contents/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Service_Area_Contents service_Area_Contents = db.Service_Area_Contents.Find(id); if (service_Area_Contents == null) { return(HttpNotFound()); } return(View(service_Area_Contents)); }
// GET: Service_Area_Contents/Edit/5 public ActionResult Edit(int?id) { if (!Check_Admin()) { return(RedirectToAction("Index", "Login")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Service_Area_Contents service_Area_Contents = db.Service_Area_Contents.Find(id); if (service_Area_Contents == null) { return(HttpNotFound()); } return(View(service_Area_Contents)); }