Ejemplo n.º 1
0
        public ResponseItem Get(string offerId)
        {
            User user = HttpContext.Items["user"] as User;

            if (_offerService.Exist(offerId) == false)
            {
                return(new ResponseItem("error", "Oferta nu exista."));
            }

            Offer offer = _offerService.GetIfAccess(offerId, user.Id);

            if (offer == null)
            {
                return(new ResponseItem("error", "Nu ai acces la aceasta oferta."));
            }

            offer.Status = CalculateStatus(offer, user);
            return(new ResponseItem("success", GetPipedOffer(offer)));
        }