Example #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());
        }
Example #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());
        }