public ActionResult Add() { SysRoleInfoMan roleinfoman = new SysRoleInfoMan(); var roleinfoList = roleinfoman.GetAllRolesInfo().ToList(); ViewBag.RoleInfoList = roleinfoList; return(View()); }
public ActionResult Edit(int ID) { var userinfoModel = userinfoman.GetEntity(ID); #region 省市数据 SysCityMan cityMan = new SysCityMan(); var provinceList = cityMan.GetProvinceByCityLevel(1).ToList(); var cityList = cityMan.GetCityByProvinceIdAndCityLevel(2, userinfoModel.Province).ToList(); ViewBag.province = provinceList; ViewBag.city = cityList; #endregion #region 用户角色关联表数据 SysUserRoleMan userroleman = new SysUserRoleMan(); var userrole = userroleman.GetModelByUserId(ID); ViewBag.UserRole = userrole; #endregion #region 角色数据 SysRoleInfoMan roleinfoman = new SysRoleInfoMan(); var roleinfoList = roleinfoman.GetAllRolesInfo().ToList(); ViewBag.RoleInfoList = roleinfoList; #endregion return(View(userinfoModel)); }