Ejemplo n.º 1
0
        public ActionResult Update(int kidId, int itemId)
        {
            var present   = PresentsManager.GetPresent(kidId, itemId);
            var viewModel = new PresentUpdateResponseViewModel(present);

            return(View("~/Views/Presents/AddOrUpdate.cshtml", viewModel));
        }
Ejemplo n.º 2
0
        public ActionResult Details(int kidId, int itemId)
        {
            var present = PresentsManager.GetPresent(kidId, itemId);

            if (present == null)
            {
                return(RedirectToAction("Index"));
            }

            var viewModel = new PresentDetailsViewModel(present);

            return(View(viewModel));
        }
Ejemplo n.º 3
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));
        }