// GET: AccountOffers/Edit/5
        public ActionResult Edit(int id)
        {
            var service = CreateServiceOfferService();
            var detail  = service.GetServiceOfferById(id);
            var model   =
                new ServiceOfferEdit
            {
                OfferId  = detail.OfferId,
                Title    = detail.Title,
                Body     = detail.Body,
                IsActive = detail.IsActive
            };

            return(View(model));
        }
        public ActionResult Edit(int id, ServiceOfferEdit model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (model.OfferId != id)
            {
                ModelState.AddModelError("", "Id Mismatch");
                return(View(model));
            }

            var service = CreateServiceOfferService();

            if (service.UpdateServiceOffer(model))
            {
                TempData["SaveResult"] = "Your offer was modified.";
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Your offer could not be updated.");
            return(View(model));
        }