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

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