public RoleDTO(Role role) { if (role == null) { return; } this.Id = role.Id; this.Name = role.Name; this.Description = role.Description; this.Status = role.Status; this.IsMasking = role.IsMasking; this.IsAllJobs = role.IsAllJobs; if (role.RoleAccesses != null) { this.Accesses = role.RoleAccesses.Select(x => MenuDTO.From(x.Menu)).ToList(); //APIDTO.From(role.Accesses); } this.EmployeeTypes = new List <int>(); if (role.RoleEmployeeTypes != null && role.RoleEmployeeTypes.Count > 0) { foreach (var roleEmpType in role.RoleEmployeeTypes) { } } }
public MenuAccessLiteWithChildDTO(MenuDTO menu) { if (menu == null) { return; } this.ControllerName = menu.ControllerName; this.ActionName = menu.ActionName; }
public MenuDTO(MenuDTO menu) { if (menu == null) { return; } //if (menu.IsSuperAdminOnly == true) return; this.Id = menu.Id; this.Name = menu.Name; this.Description = menu.Description; this.ControllerName = menu.ControllerName; this.ActionName = menu.ActionName; this.Active = menu.Active; this.ParentId = menu.ParentId; this.IsSuperAdminOnly = menu.IsSuperAdminOnly; if (this.ParentId < 1 && this.ParentId != this.Id) { this.Parent = MenuDTO.From(menu.Parent); } }
public static MenuDTO From(MenuDTO menu) { return(new MenuDTO(menu)); }