コード例 #1
0
        public ActionResult Edit(string ID)
        {
            var dao   = new CodeFooter();
            var model = dao.GetById(ID);

            return(View(model));
        }
コード例 #2
0
        // GET: Admin/Footer
        public ActionResult Index(string searchString, int page = 1, int pagesize = 10)
        {
            var footer = new CodeFooter();
            var model  = footer.ListPaging(searchString, page, pagesize);

            ViewBag.searchString = searchString;
            return(View(model));
        }
コード例 #3
0
 public ActionResult Edit(Footer model)
 {
     if (ModelState.IsValid)
     {
         var editFooter = new CodeFooter();
         var result     = editFooter.Update(model);
         if (result)
         {
             RedirectToAction("Index", "Footer");
         }
         else
         {
             ModelState.AddModelError("", "Cập nhập không thành công !");
         }
     }
     return(RedirectToAction("Index"));
 }
コード例 #4
0
 public ActionResult Create(Footer model)
 {
     if (ModelState.IsValid)
     {
         var    addFooter = new CodeFooter();
         string ID        = addFooter.Insert(model);
         if (ID != null)
         {
             RedirectToAction("Index", "Footer");
         }
         else
         {
             ModelState.AddModelError("", "Thêm mới không thành công !");
         }
     }
     return(RedirectToAction("Index"));
 }