// get for partial view edit public ActionResult AjaxEdit(int?id) { if (id == null) { id = 1; } ProposalScores ps = Repository.GetCompleteProposal(id); if (ps.proposal != null) { return(PartialView("_RateProposal", ps)); } return(RedirectToAction("Index")); }
public ActionResult _RateProposal(ProposalScores ps) { if (ModelState.IsValid) { int userId = Repository.GetUserId((string)Session["Username"]); foreach (ScoreViewModel svm in ps.scoresViews) { svm.score.editedBy = userId; svm.score.editTime = DateTime.Now; } Repository.UpdateScores(ps); return(RedirectToAction("Index")); } return(View(ps)); }