// GET: Admin/Content
        public ActionResult Index(string Search, int page = 1, int pageSize = 2)
        {
            var dao   = new contentDao();
            var model = dao.listAllPaging(Search, page, pageSize);

            ViewBag.Search = Search;
            return(View(model));
        }
        public ActionResult Edit(long id)
        {
            var dao     = new contentDao();
            var content = dao.getById(id);
            var detail  = new contentDao().viewDetail(id);

            SetViewBag(content.IdCategory);
            return(View(detail));
        }
 public ActionResult Edit(m_information model)
 {
     if (ModelState.IsValid)
     {
         var dao    = new contentDao();
         var result = dao.update(model);
         if (result)
         {
             return(RedirectToAction("Index", "Content"));
         }
         else
         {
             ModelState.AddModelError("", "Cập nhập không thành công");
         }
     }
     SetViewBag(model.IdCategory);
     return(View("Index"));
 }
 public ActionResult Create(m_information model)
 {
     if (ModelState.IsValid)
     {
         var  dao = new contentDao();
         long id  = dao.Insert(model);
         if (id > 0)
         {
             return(RedirectToAction("Index", "Content"));
         }
         else
         {
             ModelState.AddModelError("", "Thêm user thành công");
         }
     }
     SetViewBag();
     return(View());
 }