public ActionResult Edit(UploadFormViewModel postForm) { var validationOutputs = new string[0]; bool validForm = uploadManager.ValidateUploadForm(postForm, out validationOutputs); if (validForm) { string responseMessage; postForm.ReferenceId = int.Parse(Session["reference"].ToString()); bool editItem = uploadManager.EditUploadItem(postForm, out responseMessage); if (editItem) { Session["updateMessage"] = responseMessage; return(RedirectToAction("Index", "Items")); } else { Session["updateMessage"] = new string[] { responseMessage }; return(RedirectToAction("Edit", "Items", new { reference = int.Parse(Session["reference"].ToString()) })); } } else { Session["updateMessage"] = validationOutputs; return(RedirectToAction("Edit", "Items", new { reference = int.Parse(Session["reference"].ToString()) })); } }