public ActionResult EditTest(FormCollection form, Test test) { if (!user.IsManager()) { return(View("Error")); } DateTime date = Convert.ToDateTime(form["date"]); TimeSpan time = TimeSpan.Parse(form["time"]); //Test test = new Test(); //test.TestCode = Convert.ToInt32(form["TestCode"]); test.TimeStart = date + time; test.Note = form["note"]; bool check = managerDal.EditTest(test); if (check) { TempData["check"] = true; TempData["statusCTC"] = "Edit test successfull!!!!"; } else { TempData["check"] = false; TempData["statusCTC"] = "Edit test falsed!!!!--The time is not valid"; } return(RedirectToAction("EditTest/" + test.TestCode)); }