public LoginInfo ResponseAuthenticationEmail(string userId, int delaySeconds, string delayDescription, out string mobile) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new BettingPointManager()) { var entity = manager.GetUserEmail(userId); if (entity == null) { throw new ArgumentException("尚未请求邮箱认证"); } if (entity.IsSettedEmail) { throw new ArgumentException(string.Format("已于【{0:yyyy-MM-dd HH:mm:ss}】进行过邮箱认证。", entity.UpdateTime)); } var span = DateTime.Now - entity.UpdateTime.AddSeconds(delaySeconds); if (span.TotalSeconds > 0) { throw new ArgumentException(string.Format("提交认证邮箱必须在请求认证后【{0}】内完成。", delayDescription)); } entity.IsSettedEmail = true; manager.UpdateUserEmail(entity); mobile = entity.Email; //查询vip等级 var balanceManager = new UserBalanceManager(); var userReg = balanceManager.QueryUserRegister(userId); var gv = new TaskListManager(); var old = gv.QueryTaskListByCategory(userId, TaskCategory.EmailBinding); if (old == null) { //增加成长值 var orderId = Guid.NewGuid().ToString("N"); BusinessHelper.Payin_UserGrowth("邮箱绑定", orderId, userId, 50, "完成邮箱绑定可获得50点成长值"); gv.AddUserTaskRecord(new UserTaskRecord { CreateTime = DateTime.Now, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), OrderId = orderId, TaskCategory = TaskCategory.EmailBinding, TaskName = "邮箱绑定", UserId = userId, }); gv.AddTaskList(new TaskList { UserId = userId, OrderId = orderId, Content = "完成邮箱绑定可获得50点成长值", ValueGrowth = 50, IsGive = true, VipLevel = 0, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), TaskCategory = TaskCategory.EmailBinding, TaskName = "邮箱绑定", CreateTime = DateTime.Now, }); } } biz.CommitTran(); } var authBiz = new GameBizAuthBusiness(); var userToken = authBiz.GetUserToken(userId); var userManager = new UserBalanceManager(); var user = userManager.GetUserRegister(userId); return(new LoginInfo { DisplayName = user.DisplayName, LoginFrom = user.ComeFrom, UserId = userId, Message = "登录成功", Referrer = user.Referrer, RegType = user.RegType, IsSuccess = true, UserToken = userToken, }); }
public void AddAuthenticationRealName(string authFrom, string userId, string realName, string cardType, string idCardNumber, string createBy, bool checkRepet) { using (var manager = new UserRealNameManager()) { if (checkRepet) { var other = manager.QueryUserRealName(idCardNumber); if (other != null) { throw new ArgumentException(string.Format("此证件号【{0}】已被其他用户认证。", idCardNumber)); } //var other2 = manager.QueryUserRealNameByName(realName); //if (other2 != null) // throw new ArgumentException("对不起,由于系统检测到您的姓名已被绑定,请联系在线客服为您人工绑定,给您带来的不便敬请谅解,此绑定不影响您的正常购彩和提现。"); } var entity = manager.GetUserRealName(userId); if (entity != null) { entity.RealName = realName; entity.IdCardNumber = idCardNumber; entity.IsSettedRealName = true; manager.UpdateUserRealName(entity); //throw new ArgumentException(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过实名认证", entity.CreateTime)); } else { if (entity == null) { entity = new UserRealName { UserId = userId, User = manager.LoadUser(userId), AuthFrom = authFrom, RealName = realName, CardType = cardType, IdCardNumber = idCardNumber, IsSettedRealName = true, CreateBy = createBy, UpdateBy = createBy, }; manager.AddUserRealName(entity); } else { throw new ArgumentException(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过实名认证", entity.CreateTime)); } } //修改vip等级 var balanceManager = new UserBalanceManager(); var user = balanceManager.QueryUserRegister(userId); user.VipLevel = 1; balanceManager.UpdateUserRegister(user); var gv = new TaskListManager(); var old = gv.QueryTaskListByCategory(userId, TaskCategory.RealName); if (old == null) { var orderId = Guid.NewGuid().ToString("N"); //增加成长值 BusinessHelper.Payin_UserGrowth("实名认证", orderId, userId, 200, "完成实名认证获得200点成长值"); gv.AddUserTaskRecord(new UserTaskRecord { OrderId = orderId, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), CreateTime = DateTime.Now, TaskName = "实名认证", TaskCategory = TaskCategory.RealName, UserId = userId, }); //赠送成长值记录 gv.AddTaskList(new TaskList { UserId = userId, OrderId = Guid.NewGuid().ToString("N"), Content = "完成实名认证获得200点成长值", ValueGrowth = 200, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), TaskCategory = TaskCategory.RealName, VipLevel = 0, IsGive = true, TaskName = "实名认证", CreateTime = DateTime.Now, }); } } }
public string RegisterResponseMobile(string userId, string mobile, int delaySeconds, string delayDescription) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); var gv = new TaskListManager(); var old = gv.QueryTaskListByCategory(userId, TaskCategory.MobilBinding); if (old == null) { //增加成长值 var orderId = Guid.NewGuid().ToString("N"); BusinessHelper.Payin_UserGrowth("绑定手机号", orderId, userId, 100, "完成手机号绑定可获得100点成长值"); gv.AddUserTaskRecord(new UserTaskRecord { CreateTime = DateTime.Now, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), OrderId = orderId, TaskCategory = TaskCategory.MobilBinding, TaskName = "绑定手机号", UserId = userId, }); gv.AddTaskList(new TaskList { UserId = userId, OrderId = orderId, Content = "完成手机号绑定可获得100点成长值", ValueGrowth = 100, IsGive = true, VipLevel = 0, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), TaskCategory = TaskCategory.MobilBinding, TaskName = "绑定手机号", CreateTime = DateTime.Now, }); } using (var manager = new UserMobileManager()) { var entity = manager.GetUserMobile(userId); if (entity != null) { if (entity.IsSettedMobile) { throw new ArgumentException(string.Format("已于【{0:yyyy-MM-dd HH:mm:ss}】进行过手机认证。", entity.UpdateTime)); } var span = DateTime.Now - entity.UpdateTime.AddSeconds(delaySeconds); if (span.TotalSeconds > 0) { throw new ArgumentException(string.Format("提交认证手机必须在请求认证后【{0}】内完成。", delayDescription)); } entity.IsSettedMobile = true; manager.UpdateUserMobile(entity); } else { entity = new UserMobile { UserId = userId, User = manager.LoadUser(userId), AuthFrom = "LOCAL", Mobile = mobile, IsSettedMobile = true, CreateBy = userId, UpdateBy = userId, }; manager.AddUserMobile(entity); } mobile = entity.Mobile; } biz.CommitTran(); } return(mobile); }
//首页活动 绑定实名 public void AddAuthenticationRealName_Index(string authFrom, string userId, string realName, string cardType, string idCardNumber, string createBy) { #region //using (var manager = new UserRealNameManager()) //{ // var other = manager.GetOtherUserCard(cardType, idCardNumber, userId); // if (other != null && other.IsSettedRealName)//判断证件号的唯一性 // { // throw new ArgumentException(string.Format("此证件号【{0}】已被其他用户认证。", idCardNumber)); // } // var entity = manager.GetUserRealName(userId); // if (entity != null && !entity.IsSettedRealName && !string.IsNullOrEmpty(entity.IdCardNumber))//判断真实姓名的唯一性 // { // entity.RealName = realName; // entity.IdCardNumber = idCardNumber; // entity.IsSettedRealName = true; // manager.UpdateUserRealName(entity); // //throw new ArgumentException(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过实名认证", entity.CreateTime)); // } // else // { // if (entity == null) // { // entity = new UserRealName // { // UserId = userId, // User = manager.LoadUser(userId), // AuthFrom = authFrom, // RealName = realName, // CardType = cardType, // IdCardNumber = idCardNumber, // IsSettedRealName = true, // CreateBy = createBy, // UpdateBy = createBy, // }; // manager.AddUserRealName(entity); // } // else // throw new ArgumentException(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过实名认证", entity.CreateTime)); // } // //修改vip等级 // var balanceManager = new UserBalanceManager(); // var user = balanceManager.QueryUserRegister(userId); // user.VipLevel = 1; // balanceManager.UpdateUserRegister(user); // var gv = new TaskListManager(); // var old = gv.QueryTaskListByCategory(userId, TaskCategory.RealName); // if (old == null) // { // var orderId = Guid.NewGuid().ToString("N"); // //增加成长值 // BusinessHelper.Payin_UserGrowth("实名认证", orderId, userId, 200, "完成实名认证获得200点成长值"); // gv.AddUserTaskRecord(new UserTaskRecord // { // OrderId = orderId, // CurrentTime = DateTime.Now.ToString("yyyyMMdd"), // CreateTime = DateTime.Now, // TaskName = "实名认证", // TaskCategory = TaskCategory.RealName, // UserId = userId, // }); // //赠送成长值记录 // gv.AddTaskList(new TaskList // { // UserId = userId, // OrderId = Guid.NewGuid().ToString("N"), // Content = "完成实名认证获得200点成长值", // ValueGrowth = 200, // CurrentTime = DateTime.Now.ToString("yyyyMMdd"), // TaskCategory = TaskCategory.RealName, // VipLevel = 0, // IsGive = true, // TaskName = "实名认证", // CreateTime = DateTime.Now, // }); // } //} #endregion //注意:一个身份证号码可以被绑定多次 using (var manager = new UserRealNameManager()) { //var entity = manager.GetRealNameInfoByName(realName, idCardNumber); //if (entity != null && entity.IsSettedRealName)//判断证件号的唯一性 //{ // throw new ArgumentException(string.Format("此证件号【{0}】已被其他用户认证。", idCardNumber)); //} var entity = manager.GetUserRealName(userId); //if (entity != null && !entity.IsSettedRealName && !string.IsNullOrEmpty(entity.IdCardNumber))//判断真实姓名的唯一性 if (entity != null) { entity.RealName = realName; entity.IdCardNumber = idCardNumber; entity.IsSettedRealName = true; manager.UpdateUserRealName(entity); //throw new ArgumentException(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过实名认证", entity.CreateTime)); } else { if (entity == null) { entity = new UserRealName { UserId = userId, User = manager.LoadUser(userId), AuthFrom = authFrom, RealName = realName, CardType = cardType, IdCardNumber = idCardNumber, IsSettedRealName = true, CreateBy = createBy, UpdateBy = createBy, }; manager.AddUserRealName(entity); } else { throw new ArgumentException(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过实名认证", entity.CreateTime)); } } //修改vip等级 var balanceManager = new UserBalanceManager(); var user = balanceManager.QueryUserRegister(userId); user.VipLevel = 1; balanceManager.UpdateUserRegister(user); var gv = new TaskListManager(); var old = gv.QueryTaskListByCategory(userId, TaskCategory.RealName); if (old == null) { var orderId = Guid.NewGuid().ToString("N"); //增加成长值 BusinessHelper.Payin_UserGrowth("实名认证", orderId, userId, 200, "完成实名认证获得200点成长值"); gv.AddUserTaskRecord(new UserTaskRecord { OrderId = orderId, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), CreateTime = DateTime.Now, TaskName = "实名认证", TaskCategory = TaskCategory.RealName, UserId = userId, }); //赠送成长值记录 gv.AddTaskList(new TaskList { UserId = userId, OrderId = Guid.NewGuid().ToString("N"), Content = "完成实名认证获得200点成长值", ValueGrowth = 200, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), TaskCategory = TaskCategory.RealName, VipLevel = 0, IsGive = true, TaskName = "实名认证", CreateTime = DateTime.Now, }); } } }
//首页活动 手机绑定 public void AddAuthenticationMobile_Index(string authFrom, string userId, string mobile, string createBy) { using (var manager = new UserMobileManager()) { //var other = manager.GetOtherUserMobile(mobile, userId); //if (other != null && other.IsSettedMobile)//判断手机号码的唯一性 //{ // throw new ArgumentException(string.Format("此手机号【{0}】已被其他用户认证。", mobile)); //} var mobileInfo = manager.GetMobileInfoByMobile(mobile); if (mobileInfo != null && !string.IsNullOrEmpty(mobileInfo.Mobile) && mobileInfo.UserId != userId) { throw new ArgumentException(string.Format("此手机号【{0}】已被其他用户认证。", mobile)); } //var entity = manager.GetUserMobile(userId); //if (entity != null && !string.IsNullOrEmpty(entity.Mobile) && !entity.IsSettedMobile) //{ // entity.Mobile = mobile; // entity.IsSettedMobile = true; // manager.UpdateUserMobile(entity); // //throw new ArgumentException(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过手机认证", entity.CreateTime)); //} if (mobileInfo != null && !string.IsNullOrEmpty(mobileInfo.Mobile) && !mobileInfo.IsSettedMobile) { //mobileInfo.UserId = userId; mobileInfo.UpdateBy = userId; mobileInfo.UpdateTime = DateTime.Now; mobileInfo.Mobile = mobile; mobileInfo.IsSettedMobile = true; manager.UpdateUserMobile(mobileInfo); } else { if (mobileInfo == null) { mobileInfo = new UserMobile { UserId = userId, User = manager.LoadUser(userId), AuthFrom = authFrom, Mobile = mobile, IsSettedMobile = true, CreateBy = createBy, UpdateBy = createBy, }; manager.AddUserMobile(mobileInfo); var gv = new TaskListManager(); var old = gv.QueryTaskListByCategory(userId, TaskCategory.MobilBinding); if (old == null) { //增加成长值 var orderId = Guid.NewGuid().ToString("N"); BusinessHelper.Payin_UserGrowth("绑定手机号", orderId, userId, 100, "完成手机号绑定可获得100点成长值"); gv.AddUserTaskRecord(new UserTaskRecord { CreateTime = DateTime.Now, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), OrderId = orderId, TaskCategory = TaskCategory.MobilBinding, TaskName = "绑定手机号", UserId = userId, }); gv.AddTaskList(new TaskList { UserId = userId, OrderId = orderId, Content = "完成手机号绑定可获得100点成长值", ValueGrowth = 100, IsGive = true, VipLevel = 0, CurrentTime = DateTime.Now.ToString("yyyyMMdd"), TaskCategory = TaskCategory.MobilBinding, TaskName = "绑定手机号", CreateTime = DateTime.Now, }); } } else { throw new ArgumentException(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过手机认证", mobileInfo.CreateTime)); } } } }