예제 #1
0
        public ActionResult Add()
        {
            SysRoleInfoMan roleinfoman  = new SysRoleInfoMan();
            var            roleinfoList = roleinfoman.GetAllRolesInfo().ToList();

            ViewBag.RoleInfoList = roleinfoList;
            return(View());
        }
예제 #2
0
        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));
        }