Exemple #1
0
        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)
                {
                }
            }
        }
Exemple #2
0
        public MenuAccessLiteWithChildDTO(MenuDTO menu)
        {
            if (menu == null)
            {
                return;
            }

            this.ControllerName = menu.ControllerName;
            this.ActionName     = menu.ActionName;
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
 public static MenuDTO From(MenuDTO menu)
 {
     return(new MenuDTO(menu));
 }