public ActionResult Register(string userFirstName, string userLastName, DateTime userDob, string userGender, string userEmail, string userPassword) { if (!String.IsNullOrEmpty(userFirstName) && !String.IsNullOrEmpty(userLastName) && userDob != null && !String.IsNullOrEmpty(userGender) && !String.IsNullOrEmpty(userEmail) && !String.IsNullOrEmpty(userPassword) && userPassword.Length >= 6) { var result = logic.Register(userFirstName, userLastName, userDob, userGender, userEmail, userPassword); if (result == null) { ViewBag.Err = "Internal server error. Can't create user"; return(View()); } else { ViewBag.Msg = "Registration Successful"; return(RedirectToAction("Login")); } } else { ViewBag.Err = "Fields can't be left empty and must match the criteria. Can't create user"; return(View()); } }