Пример #1
0
        public ActionResult Index()
        {
            CatalogIndexView vm = new CatalogIndexView();

            vm.Catalogs = _catalogService.FindAll();

            return(View(vm));
        }
Пример #2
0
        public ActionResult EditCatalogPost(RoleEditCatalogView vm)
        {
            int cnt = 0;

            if (ModelState.IsValid)
            {
                cnt = _CatalogService.ModifyRoleCatalogs(vm.RoleId, vm.SelectedCatalogIds);
            }

            if (cnt > 0)
            {
                TempData["Message"] = string.Format("{0},{1}", "success", "修改成功");
            }
            else
            {
                TempData["Message"] = string.Format("{0},{1}", "warning", "修改失敗");
            }

            vm.Catalogs = _CatalogService.FindAll();

            return(View("EditCatalog", vm));
        }