public ActionResult Register(AccessModel model) { if (!ModelState.IsValid) { return(View(model)); } else { int iRet = model.Register(); if (iRet > 0) { return(RedirectToAction("index", "home")); } else if (iRet == -5) { model.ErrorMessage = "This user name or email is taken"; } else { model.ErrorMessage = "You failed to log in"; } } return(View(model)); }