Exemplo n.º 1
0
        public List <Detail> GetAllUserRoleByCompanyId(int companyId)
        {
            DBHelper._UserRole       dbhelp = new DBHelper._UserRole();
            UserRolePermissionModels userRolePermissionModels = new UserRolePermissionModels();

            return(dbhelp.GetAllByCompanyId(companyId).Select(s => new Detail()
            {
                Id = s.Id,
                Name = s.Name,
                PermissionCatalogList = userRolePermissionModels.GetAllUserRolePermissionByUserRoleId(s.Id).Select(t => new UserRolePermissionCatalog()
                {
                    Id = t.PermissionCatalogId,
                    Name = t.PermissionCatalogName,
                    Description = t.PermissionDescription
                }).ToList <UserRolePermissionCatalog>()
            }).ToList <Detail>());
        }
Exemplo n.º 2
0
        public Detail getUserRoleById(int id)
        {
            DBHelper._UserRole       dbhelp_userRole          = new DBHelper._UserRole();
            UserRolePermissionModels userRolePermissionModels = new UserRolePermissionModels();
            UserRole userRole = dbhelp_userRole.GetByid(id);

            return(new Detail()
            {
                Id = userRole.Id,
                Name = userRole.Name,
                PermissionCatalogList = userRolePermissionModels.GetAllUserRolePermissionByUserRoleId(id).Select(s => new UserRolePermissionCatalog()
                {
                    Id = s.PermissionCatalogId,
                    Name = s.PermissionCatalogName,
                    Description = s.PermissionDescription
                }).ToList <UserRolePermissionCatalog>()
            });
        }