Exemple #1
0
        public RightsView UpdateRights(int id, string name, string url, string description, bool isshow)
        {
            Rights rights = this._rightsRepository.FindBy(id);

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

            rights.UpdateRights(name, url, description, isshow);
            this._uow.Commit();
            return(rights.ConvertToRightsView());
        }
Exemple #2
0
        public RightsView UpdateRights(AddRightsRequest request)
        {
            Rights rights = this._rightsRepository.FindBy(request.Id);

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

            rights.UpdateRights(request.Name, request.Url, request.Description, request.IsShow, request.Icon);
            this._uow.Commit();
            return(rights.ConvertToRightsView());
        }
Exemple #3
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());
        }