示例#1
0
        public ActionResult Edit(int id)
        {
            var result = new SlidesDao().GetById(id);

            SetViewBag();
            return(View(result));
        }
示例#2
0
 public ActionResult Create(SLIDE model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var dao = new SlidesDao();
             int id  = dao.Insert(model);
             if (id > 0)
             {
                 SetAlert("Thêm thành công", "success");
                 return(RedirectToAction("Index", "Slide"));
             }
             else
             {
                 ModelState.AddModelError("", "Thêm thất bại");
             }
         }
         SetViewBag(model.ID);
         return(View(model));
     }
     catch
     {
         return(View());
     }
 }
示例#3
0
        public JsonResult ChangeStatus(int id)
        {
            var result = new SlidesDao().ChangeStatus(id);

            return(Json(new
            {
                status = result
            }));
        }
示例#4
0
 public ActionResult Edit(SLIDE model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var result = new SlidesDao().Update(model);
             if (result)
             {
                 SetAlert("Cập nhật thành công", "success");
                 return(RedirectToAction("Index", "Slide"));
             }
             else
             {
                 ModelState.AddModelError("", "Cập nhật thất bại");
             }
         }
         SetViewBag(model.ID);
         return(View(model));
     }
     catch
     { return(View()); }
 }
示例#5
0
        public ActionResult Index()
        {
            var model = new SlidesDao().GetAll();

            return(View(model));
        }
示例#6
0
        public ActionResult BotSlides()
        {
            var model = new SlidesDao().ListByGroupId(2);

            return(PartialView(model));
        }