public ActionResult DeleteConfirmed(int num) { club_page page = Db.club_page.Find(num); Db.club_page.Remove(page); Db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(int num = 0) { club_page page = Db.club_page.Find(num); if (page == null) { return(HttpNotFound()); } return(View(page)); }
public ActionResult Edit(club_page page) { if (ModelState.IsValid) { Db.Entry(page).State = EntityState.Modified; Db.SaveChanges(); return(RedirectToAction("index")); } return(View(page)); }
public ActionResult Create(club_page page) { if (ModelState.IsValid) { Db.club_page.Add(page); Db.SaveChanges(); return(RedirectToAction("index")); } return(View(page)); }
public ActionResult ChangeApproval(int num = 0) { string result = ""; club_page page = Db.club_page.Find(num); if (page != null) { page.IsApproval = page.IsApproval == true ? false : true; result = page.IsApproval == true ? "Kategori başarıyla onaylandı." : "Kategorinin onayı başarıyla kaldırıldı."; Db.SaveChanges(); } return(Content("<script type=\"text/javascript\">SuccessInfo('" + result + "');</script>")); }