Ejemplo n.º 1
0
        public ActionResult Details(int id)
        {
            Data.Offer offer = _db.Offers.Single(o => o.OfferId == id);

            OfferModel model = new OfferModel
                                   {
                                       Amount = offer.Amount,
                                       BuyerName = offer.BuyerName,
                                       EmailAddress = offer.EmailAddress,
                                   };

            return View(model);
        }
Ejemplo n.º 2
0
        public ActionResult Index(OfferModel model)
        {
            if (!ModelState.IsValid)
            {
                return View("Error");
            }

            var proxy = new OfferService.ServiceClient();
            var response = proxy.SubmitOffer(new SubmitOfferRequest
                                                 {
                                                     RequestId = Guid.NewGuid(),
                                                     Offer = new Offer
                                                                 {
                                                                     Amount = model.Amount,
                                                                     BuyerName = model.BuyerName,
                                                                     EmailAddress = model.EmailAddress,
                                                                 }
                                                 });

            ViewData["ResponseText"] = response.ResponseText;

            return View("Thanks");
        }