/// <summary> /// 更新实名认证 /// </summary> public void UpdateRealNameAuthentication(string userId, string realName, string idCard, string updateBy) { using (var manager = new UserRealNameManager()) { var other = manager.QueryUserRealName(idCard); if (other != null) { throw new ArgumentException(string.Format("此证件号【{0}】已被其他用户认证。", idCard)); } } //开启事务 using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new UserRealNameManager(); var entity = manager.GetUserRealName(userId); var realNameInfo = manager.GetRealNameInfoByName(realName, idCard); if (entity == null) { throw new ArgumentException("此用户从未进行过实名认证"); } entity.RealName = realName; entity.IsSettedRealName = true; entity.IdCardNumber = idCard; entity.UpdateBy = updateBy; entity.UpdateTime = DateTime.Now; manager.UpdateUserRealName(entity); biz.CommitTran(); } }
public void UpdateAuthenticationRealName(string authFrom, string userId, string realName, string cardType, string idCardNumber, string updateBy) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new UserRealNameManager()) { var entity = manager.GetUserRealName(userId); var realNameInfo = manager.GetRealNameInfoByName(realName, idCardNumber); if (entity == null) { throw new ArgumentException("此用户从未进行过实名认证"); } //if (realNameInfo != null && realNameInfo.UserId != userId) //{ // if (!string.IsNullOrEmpty(realNameInfo.RealName) && realNameInfo.IsSettedRealName) // throw new Exception("当前信息已被他人占用!"); //} entity.AuthFrom = authFrom; entity.RealName = realName; entity.CardType = cardType; entity.IdCardNumber = idCardNumber; entity.UpdateBy = updateBy; entity.IsSettedRealName = true; manager.UpdateUserRealName(entity); } biz.CommitTran(); } }