public ActionResult DeleteConfirmed(int id) { HomeCharach homeCharach = db.HomeCharaches.Find(id); db.HomeCharaches.Remove(homeCharach); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Icon,Title,Text")] HomeCharach homeCharach) { if (ModelState.IsValid) { db.Entry(homeCharach).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(homeCharach)); }
public ActionResult Create([Bind(Include = "Id,Icon,Title,Text")] HomeCharach homeCharach) { if (ModelState.IsValid) { db.HomeCharaches.Add(homeCharach); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(homeCharach)); }
// GET: Admin/HomeCharaches/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HomeCharach homeCharach = db.HomeCharaches.Find(id); if (homeCharach == null) { return(HttpNotFound()); } return(View(homeCharach)); }