public ActionResult Register(BuyerInfoRegisterViewModel model) { if (ModelState.IsValid) { } else { ModelState.AddModelError("", "输入数据无效,请重新输入"); return(View()); } if (!model.Password.Equals(model.PasswordAgain)) { ModelState.AddModelError("", "两次输入密码不一致"); return(View()); } int buyerId = 0; string msg = ""; bool ret = BuyerInfoBll.RequestRegisterNewUser(model.PhoneNumber, model.Password, model.RegisterCode, out buyerId, out msg); if (ret) { return(RedirectToAction("Login", new { LoginName = model.PhoneNumber })); } else { ModelState.AddModelError("", "注册失败:" + msg); return(View()); } }
public void HandleInsertTest() { int id = 0; //Assert.IsTrue(BuyerInfoBll.RequestRegisterVerificationCode("18903838100",out _errMsg)); Assert.IsTrue(BuyerInfoBll.RequestRegisterNewUser("18903838100", "123456", "99999999", out id, out _errMsg)); }