Beispiel #1
0
 public IResult Update(Profile profile, int reqUserId)
 {
     if (!AuthorHelper.OwnerAccess(profile.UserId, reqUserId))
     {
         return(new Result(false, Messages.OwnerAccess));
     }
     _profileDal.Update(profile);
     return(new Result(true, Messages.Updated));
 }
        public IResult Update(Advert advert)
        {
            try
            {
                if (!AuthorHelper.OwnerAccess(advert.UserId, advert.User.Id))
                {
                    return(new Result(false, Messages.OwnerAccess));
                }

                _advertDal.Update(advert);
                return(new Result(true, Messages.Updated));
            }
            catch (Exception error)
            {
                return(new Result(false, error.Message));
            }
        }