public ActionResult Register(PatientView model) { try { if (ModelState.IsValid) { if (_patientBusiness.CheckExistsAccount(model.Account, 0)) { ModelState.AddModelError("ExistsAccountError", "Tài khoản này đã tồn tại trong hệ thống"); } model.DateCreate = DateTime.Now; if (_patientBusiness.Add(model)) { _patientBusiness.Save(); return(Redirect("/dang-nhap.html")); } } return(View(model)); } catch (Exception) { return(View(model)); } }