public ActionResult Index() { List <RolePrivilegeViewModel> model = new List <RolePrivilegeViewModel>(); var data = _roleService.GetRolePrivileges(new GetPrivilegeByRoleRequest { RoleId = this.UserProfile().RoleId }); if (data.IsSuccess && data.Privileges.Count > 0) { model = data.Privileges.MapTo <RolePrivilegeViewModel>(); } ViewBag.RoleGroups = _roleGroupService.GetRoleGroups(new Services.Requests.RoleGroup.GetRoleGroupsRequest { Take = -1, SortingDictionary = new Dictionary <string, SortOrder> { { "Name", SortOrder.Ascending } } }) .RoleGroups.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString(), Selected = this.UserProfile().RoleId == x.Id }).ToList(); ViewBag.RoleId = this.UserProfile().RoleId; return(View(model)); }
public CreateUserViewModel CreateViewModel(CreateUserViewModel viewModel) { viewModel.RoleGroupList = _roleGroupService.GetRoleGroups(new Services.Requests.RoleGroup.GetRoleGroupsRequest { Take = -1, SortingDictionary = new Dictionary <string, SortOrder> { { "Name", SortOrder.Ascending } } }) .RoleGroups.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString(), Selected = viewModel.RoleId == x.Id ? true : false }).ToList(); viewModel.IsActive = true; viewModel.RolePrivilegeOption = _rolePrivilegeService.GetRolePrivileges(new Services.Requests.Privilege.GetPrivilegeByRoleRequest { RoleId = viewModel.RoleId }).Privileges.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList(); return(viewModel); }
public CreateMenuViewModel CreateViewModel(CreateMenuViewModel viewModel) { viewModel.RoleGroupOptions = _roleService.GetRoleGroups( new Services.Requests.RoleGroup.GetRoleGroupsRequest { Skip = 0, Take = 0 }).RoleGroups.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList(); List <SelectListItem> menuList = _menuService.GetMenus( new Services.Requests.Menu.GetMenusRequest { Skip = 0, Take = 0 }).Menus.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList(); //menuList.Insert(0, new SelectListItem { Text = "This is Root", Value = "0", Selected = true }); viewModel.MenuOptions = menuList; return(viewModel); }
public ActionResult UserinfoList() { //用户信息 var list = Mapper.Map <IEnumerable <UserinfoModel> >(userService.GetUsers(0, 0, null, null, null, 1, 10)); //管理员组 ViewData["RGroups"] = new SelectList(RGroupService.GetRoleGroups(), "RG_no", "RG_name"); return(View(list)); }
public CreateUserViewModel CreateViewModel(CreateUserViewModel viewModel) { viewModel.RoleGroupList = _roleGroupService.GetRoleGroups( new Services.Requests.RoleGroup.GetRoleGroupsRequest { Skip = 0, Take = 0 }).RoleGroups.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList(); return(viewModel); }
public ActionResult Index() { //var highlightOrder = _highlightOrderService.GetHighlights(new GetHighlightOrdersRequest()); var viewModel = new HighlightOrderViewModel(); viewModel.Groups = _highlightGroupService.GetHighlightGroups(new GetHighlightGroupsRequest { Take = -1, SortingDictionary = new Dictionary <string, SortOrder> { { "Order", SortOrder.Ascending } } }).HighlightGroups.Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.Name }).ToList(); viewModel.Groups.Insert(0, new SelectListItem { Value = "0", Text = "Choose Group" }); viewModel.RoleGroupOptions = _roleService.GetRoleGroups(new Services.Requests.RoleGroup.GetRoleGroupsRequest { Take = -1, SortingDictionary = new Dictionary <string, SortOrder> { { "Name", SortOrder.Ascending } } }).RoleGroups.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList(); return(View(viewModel)); }
public ActionResult Create() { var viewModel = new KpiTransformationViewModel() { RoleGroupOptions = new MultiSelectList(_roleService.GetRoleGroups(new Services.Requests.RoleGroup.GetRoleGroupsRequest { Take = -1, SortingDictionary = new Dictionary <string, SortOrder> { { "Name", SortOrder.Ascending } } }).RoleGroups, "Id", "Name") }; SetPeriodeTypes(viewModel.PeriodeTypes); ViewBag.Title = "Create Transformation Schedule"; return(View(viewModel)); }
/// <summary> /// 获取所有管理权限组 /// </summary> /// <returns></returns> public ActionResult GetRoleGroups() { return(Json(RGroupService.GetRoleGroups())); }
public void GetDataRowCount(GridViewCustomBindingGetDataRowCountArgs e) { e.DataRowCount = _roleGroupService.GetRoleGroups(new GetRoleGroupsRequest()).RoleGroups.Count; }