Esempio n. 1
0
        public IActionResult Add(string id)
        {
            var roles = new RoleMenuDto();

            if (id.IsEmpty())
            {
                return(View(roles));
            }
            else
            {
                var role = _roleServices.QueryableToEntity(c => c.RoleId == SqlFunc.ToInt64(id));
                var list = _rolemenuServices.QueryableToList(c => c.RoleId == SqlFunc.ToInt64(id));
                roles = new RoleMenuDto()
                {
                    RoleId   = role?.RoleId.ToString(),
                    RoleName = role?.RoleName,
                    RoleType = role?.RoleType,
                    Remark   = role?.Remark,
                    Children = list.Select(x => new RoleMenuItemDto()
                    {
                        MenuId      = x.MenuId.ToString(),
                        RoleId      = x.RoleId.ToString(),
                        WarehouseId = x.WarehouseId.ToString()
                    }).ToList()
                };
                this.ViewData["stores"] = _warehouseServices.Queryable().ToList().ToArray();
                return(View(roles));
            }
        }
Esempio n. 2
0
        public IActionResult Add(string id)
        {
            var roles = new RoleMenuDto();

            if (id.IsEmpty())
            {
                return(View(roles));
            }
            else
            {
                var role = _roleServices.QueryableToEntity(c => c.RoleId == SqlFunc.ToInt64(id));
                var list = _rolemenuServices.QueryableToList(c => c.RoleId == SqlFunc.ToInt64(id));
                roles = new RoleMenuDto()
                {
                    RoleId   = role?.RoleId.ToString(),
                    RoleName = role?.RoleName,
                    RoleType = role?.RoleType,
                    Remark   = role?.Remark,
                    Children = list
                };
                return(View(roles));
            }
        }