protected bool ValidateModel(OnsiteTrainingModel model) { return ModelState.IsValid; }
public ActionResult OnsiteTraining(OnsiteTrainingModel model) { string error = String.Empty; if (ValidateModel(model)) { EmploymentBl.SaveOnsiteTrainingReport(model, out error); if (!string.IsNullOrEmpty(error)) { ViewBag.Error = error; return View(model); } else { return RedirectToAction("Roster"); } } return View(model); }