Beispiel #1
0
        public ActionResult UserSave(int id = 0)
        {
            SysUserInfo model = null;

            if (id > 0)
            {
                model = _sysUserRespository.Get(id);
            }
            if (model == null)
            {
                model = new SysUserInfo();
            }
            ViewBag.sysUserState = this.ToSelectTitle(new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "正常", Value = "1"
                },
                new SelectListItem()
                {
                    Text = "锁定", Value = "2"
                }, new SelectListItem()
                {
                    Text = "注销", Value = "3"
                }
            }, emptyTitle: "请选择");
            var roleService = AutofacDependencyResolver.Current.GetService <ISysRolesRepository>();

            ViewBag.roles = this.ToSelectTitle(roleService.GetRoleList().Select(o => new SelectListItem()
            {
                Value = o.RoleId.ToString(), Text = o.Title
            }));
            return(View(model));
        }
Beispiel #2
0
 public SysUser GetForm(string id)
 {
     return(_SysUserRespository.Get(id));
 }