/// <summary> /// This page should allow the user to edit a deed's records. /// </summary> /// <returns></returns> public ActionResult Update(int kidId, DateTime timeOfDeed) { var deed = DeedsManager.GetDeeds(kidId, timeOfDeed); var viewModel = new DeedUpdateResponseViewModel(deed); return(View("~/Views/Deeds/AddOrUpdate.cshtml", viewModel)); }
/// <summary> /// This page should show all relevant data about a given deed. Such data includes the date, what happened, who did it, if it was naughty or nice, etc... /// </summary> /// <returns></returns> public ActionResult Details(int kidId, DateTime timeOfDeed) { var deed = DeedsManager.GetDeeds(kidId, timeOfDeed); if (deed == null) { return(RedirectToAction("Index")); } var viewModel = new DeedDetailsViewModel(deed); return(View(viewModel)); }
public ActionResult Update(int kidId, DateTime timeOfDeed, DeedUpdateRequestViewModel requestModel) //Needs a request view model { var deed = DeedsManager.GetDeeds(kidId, timeOfDeed); requestModel.UpdateDeedModel(deed); bool success = DeedsManager.Save(deed); var viewModel = new DeedUpdateResponseViewModel(deed); viewModel.UpdateSuccess = success; return(View("~/Views/Deeds/AddOrUpdate.cshtml", viewModel)); }