Exemplo n.º 1
0
        public ActionResult Update(int ID)
        {
            ViewBag.Type = new SelectList(new F_Author().Form());
            var author = new F_Author().ViewDetail(ID);

            return(View(author));
        }
Exemplo n.º 2
0
        // 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));
        }
Exemplo n.º 3
0
        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"));
        }
Exemplo n.º 4
0
 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"));
 }