コード例 #1
0
        public ActionResult Index(int page = 1, int page_size = 10)
        {
            var dao   = new menu_type_dao();
            var model = dao.ListAllPaging(page, page_size);

            return(View(model));
        }
コード例 #2
0
 public ActionResult DeleteAllChecked(string ids)
 {
     if (ids != "" && ids != null)
     {
         string[] array_id = ids.Split(',');
         var      dao      = new menu_type_dao();
         foreach (var id in array_id)
         {
             dao.Delete(id);
         }
     }
     return(RedirectToAction("Index"));
 }
コード例 #3
0
        public ActionResult Edit(menu_type type)
        {
            if (ModelState.IsValid)
            {
                var dao = new menu_type_dao();

                var result = dao.Update(type);
                if (result)
                {
                    SetAlert(StaticResources.Resources.Pub_UpdateSucess, "success");
                    return(RedirectToAction("Index", "MenuType"));
                }
                else
                {
                    ModelState.AddModelError("", StaticResources.Resources.UpdateMenuTypeFailed);
                }
            }
            return(View());
        }
コード例 #4
0
        public ActionResult Edit(string id)
        {
            var model = new menu_type_dao().Get_By_Id(id);

            return(View(model));
        }
コード例 #5
0
        public void SetListType(string selected_id = null)
        {
            var dao = new menu_type_dao();

            ViewData["MenuType"] = new SelectList(dao.ListAll(), "id", "name", selected_id);
        }