public ActionResult Create([Bind(Include = "PatientId,Name")] PatientViewModel pvm) { if (ModelState.IsValid) { Patient patient = new Patient() { Name = pvm.Name, PatientId = pvm.PatientId }; IBL bl = new BLImplement(); try { bl.addPatient(patient); ViewBag.Message = String.Format("The patient {0} is successfully added", pvm.Name); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Message = String.Format(ex.Message); return(RedirectToAction("Index")); } } return(View(pvm)); }