public virtual void RealNameAuthentication(string realName, string idNo, IdNoType idType) { if (this.HasRealNameAuthentication()) throw new RealNameAuthenticationIsPassedException(); this.RealName = realName; this.IdNo = idNo; this.IdNoType = idType; }
public UserRealNameAuth(int userID, string realName, IdNoType idType, string idNo) { Check.Argument.IsNotNegativeOrZero(userID, "userID"); Check.Argument.IsNotEmpty(realName, "realName"); Check.Argument.IsNotNull(idType, "idType"); Check.Argument.IsNotEmpty(idNo, "idNo"); this.UserID = userID; this.RealName = realName; this.IdType = idType; this.IdNo = idNo; }
public ActionResult RealNameAuthentication(string realname, string identityno, IdNoType idNoType = IdNoType.IdentificationCard) { var result = FCJsonResult.CreateFailResult(this.Lang("Unable to update your identity informations. Please try again.")); if (!string.IsNullOrEmpty(realname.NullSafe()) && !string.IsNullOrEmpty(identityno.NullSafe())) { if (idNoType == IdNoType.IdentificationCard && (identityno.NullSafe().Length >= 6 && identityno.NullSafe().Length <= 18)) { try { var cmd = new UserRealNameAuth(this.CurrentUser.UserID, realname, idNoType, identityno); this.CommandBus.Send(cmd); this.CurrentUser.IdNoType = idNoType; this.CurrentUser.IdNo = identityno; this.CurrentUser.RealName = realname; result = FCJsonResult.CreateSuccessResult(this.Lang("Identity information updated successfuly.")); } catch (CommandExecutionException ex) { if (ex.ErrorCode == (int)ErrorCode.RealNameAuthenticationIsPassed) result = FCJsonResult.CreateFailResult(this.Lang("Identity informations have updated yet! Please refresh the page to see your identity infomations.")); else Log.Error("Action RealNameAuthentication Error", ex); } } } return Json(result); }
public RealNameAuthenticated(int userID, string realName, string idNo, IdNoType idType) { this.UserID = userID; this.RealName = realName; this.IdNo = idNo; this.IdType = idType; }
public ActionResult SetRealNameAuthentication(string truename, IdNoType idNoType, string number) { if (string.IsNullOrEmpty(truename.NullSafe()) || string.IsNullOrEmpty(number.NullSafe())) return Json(new FCJsonResult(-1)); if (idNoType == IdNoType.IdentificationCard && number.NullSafe().Length < 6 && number.NullSafe().Length > 18) return Json(new { Code = -2, Msg = "身份证号不合法" }); try { var cmd = new UserRealNameAuth(this.CurrentUser.UserID, truename, idNoType, number); this.CommandBus.Send(cmd); return Redirect("~/myfullcoin"); } catch (CommandExecutionException ex) { return Json(new FCJsonResult(ex.ErrorCode)); } }