Esempio n. 1
0
 public ActionResult Creat(RoleModel role_mod)
 {
     if (!ModelState.IsValid) return View(role_mod);
     if (user_get.UserCheckNameExist(role_mod.Name)) {
         ModelState.AddModelError("", "角色名已存在。");
         return View(role_mod);
     }
     user_sub.RoleAdd(new mRole {
         Name = role_mod.Name
     });
     return RedirectToAction("List", "Role");
 }
Esempio n. 2
0
 public ActionResult Index(int id, RoleModel role_mod)
 {
     if (!ModelState.IsValid) return View(role_mod);
     mRole role = user_get.RoleGet(id);
     role.Name = role_mod.Name;
     user_sub.RoleUpdate(role);
     return View(role_mod);
 }
Esempio n. 3
0
 public ActionResult Index(int id)
 {
     mRole role = user_get.RoleGet(id);
     RoleModel rolemod = new RoleModel {
         Name = role.Name
     };
     ViewBag.Role = role;
     return View(rolemod);
 }