public ActionResult Update(int ID) { ViewBag.Type = new SelectList(new F_Author().Form()); var author = new F_Author().ViewDetail(ID); return(View(author)); }
// GET: Admin/Author public ActionResult Index(int page = 1, int pageSize = 10) { F_Author fauthor = new F_Author(); var model = fauthor.ListAllPaging(page, pageSize); return(View(model)); }
public ActionResult Delete(long ID) { var fauthor = new F_Author(); long?res = fauthor.Delete(fauthor.FindEntity(ID)); if (res > 0) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("Notice", "Them khong thanh cong"); } return(View("Index")); }
public ActionResult Create(Author us) { if (ModelState.IsValid) { var fauthor = new F_Author(); int res = fauthor.Insert(us); if (res > 0) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("Notice", "Them khong thanh cong"); } } return(View("Index")); }