Exemplo n.º 1
0
        public ActionResult Create(PresentUpdateRequestViewModel requestModel)
        {
            var present = new Present();

            requestModel.UpdatePresentModel(present);

            bool success = PresentsManager.Save(present);

            return(RedirectToAction("Details", new { kidId = present.KidID, itemId = present.ItemID }));
        }
Exemplo n.º 2
0
        public ActionResult Update(int kidId, int itemId, PresentUpdateRequestViewModel requestModel)
        {
            var present = PresentsManager.GetPresent(kidId, itemId);

            requestModel.UpdatePresentModel(present);

            bool success = PresentsManager.Save(present);

            var viewModel = new PresentUpdateResponseViewModel(present);

            viewModel.UpdateSuccess = success;

            return(View("~/Views/Presents/AddOrUpdate.cshtml", viewModel));
        }