Ejemplo n.º 1
0
        public RightsView AddRightsChild(int id, string name, string url, string description, bool isshow)
        {
            Rights rights = this._rightsRepository.FindBy(id);

            if (rights == null)
            {
                throw new EntityIsInvalidException <string>(id.ToString());
            }

            Rights result = rights.AddChild(name, url, description, isshow);

            this._uow.Commit();
            return(result.ConvertToRightsView());
        }
Ejemplo n.º 2
0
        public RightsView AddRights(AddRightsRequest request)
        {
            Rights rights = this._rightsRepository.FindBy(request.ParentId);

            if (rights == null)
            {
                throw new EntityIsInvalidException <string>(request.ParentId.ToString());
            }

            Rights result = rights.AddChild(request.Name, request.Url, request.Description, request.IsShow, request.Icon);

            this._uow.Commit();
            return(result.ConvertToRightsView());
        }