Exemplo n.º 1
0
        public IHttpActionResult PutOfferStatus(int id, OfferStatuses status)
        {
            OfferModel offerWithUpdatedStatus = offersService.UpdateOfferStatus(id, status);

            if (offerWithUpdatedStatus == null)
            {
                return(NotFound());
            }

            return(Ok(offerWithUpdatedStatus));
        }
Exemplo n.º 2
0
        public OfferModel UpdateOfferStatus(int id, OfferStatuses newStatus)
        {
            OfferModel offer = db.OffersRepository.GetByID(id);

            if (offer != null)
            {
                offer.Status = newStatus;
                db.OffersRepository.Update(offer);
                db.Save();
            }

            return(offer);
        }