public void UpdateAuthenticationEmail(string authFrom, string userId, string email, string updateBy) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new BettingPointManager()) { var entity = manager.GetUserEmail(userId); var emailInfo = manager.GetEmailInfoByEmail(email); if (entity == null) { throw new ArgumentException("此用户从未进行过实名认证"); } if (emailInfo != null && emailInfo.UserId != userId) { if (!string.IsNullOrEmpty(emailInfo.Email) && emailInfo.IsSettedEmail) { throw new Exception("当前邮箱已被他人占用!"); } } entity.AuthFrom = authFrom; entity.Email = email; entity.UpdateBy = updateBy; entity.IsSettedEmail = true; manager.UpdateUserEmail(entity); } biz.CommitTran(); } }
/// <summary> /// 添加专家吐槽 /// </summary> public void AddExperterComments(string userId, string sendUserId, CommentsTpye commentsTpye, string analyzeSchemeId, string recommendSchemeId, string content, string currentTime) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new ExperterCommentsManager(); var entity = new ExperterComments() { UserId = userId, CommentsTpye = commentsTpye, AnalyzeSchemeId = analyzeSchemeId, RecommendSchemeId = recommendSchemeId, DealWithType = DealWithType.NoneDealWith, Content = content, SendUserId = sendUserId, DisposeOpinion = "", CurrentTime = currentTime, CreateTime = DateTime.Now, }; manager.AddExperterComments(entity); biz.CommitTran(); } }
public void SubmitUserIdea(UserIdeaInfo_Add userIdea) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new UserIdeaManager()) { manager.AddUserIdea(new UserIdea { Description = userIdea.Description, Category = userIdea.Category, Status = userIdea.Status, CreateUserId = userIdea.CreateUserId, CreateUserDisplayName = userIdea.CreateUserDisplayName, IsAnonymous = userIdea.IsAnonymous, UpdateUserId = userIdea.CreateUserId, CreateTime = DateTime.Now, CreateUserMoibile = userIdea.CreateUserMoibile, UpdateTime = DateTime.Now, UpdateUserDisplayName = userIdea.CreateUserDisplayName, PageOpenSpeed = userIdea.PageOpenSpeed, InterfaceBeautiful = userIdea.InterfaceBeautiful, ComposingReasonable = userIdea.ComposingReasonable, OperationReasonable = userIdea.OperationReasonable, ContentConveyDistinct = userIdea.ContentConveyDistinct, }); } biz.CommitTran(); } }
public void LogOffUserAgent(string userId) { //开启事务 using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new UserBalanceManager(); var reg = manager.GetUserRegister(userId); if (reg == null) { throw new Exception("不存在此用户:" + userId); } reg.IsAgent = false; manager.UpdateUserRegister(reg); var userManager = new UserManager(); var user = userManager.LoadUser(userId); if (user == null) { throw new Exception("不存在此用户:" + userId); } var role = user.RoleList.FirstOrDefault(p => p.RoleId == "Agent"); if (role != null) { user.RoleList.Remove(role); } biz.CommitTran(); } }
public void Register(LoginLocal loginEntity, string userId) { if (loginEntity.Password == null) { loginEntity.Password = C_DefaultPassword; } loginEntity.Password = Encipherment.MD5(string.Format("{0}{1}", loginEntity.Password, _gbKey)).ToUpper(); using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var loginManager = new LoginLocalManager()) { var tmp = loginManager.GetLoginByName(loginEntity.LoginName); if (tmp != null) { throw new AuthException("登录名已经存在 - " + loginEntity.LoginName); } loginEntity.User = loginManager.LoadUser(userId); loginEntity.Register = loginManager.LoadRegister(userId); loginManager.Register(loginEntity); } biz.CommitTran(); } }
public void SetUserMobile(string userId, string newMobile, string updateBy) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new UserMobileManager()) { if (!manager.ExistMobile(newMobile)) { throw new ArgumentException(string.Format("此手机号【{0}】已被其他用户认证。", newMobile)); } var entity = manager.GetUserMobile(userId); if (entity == null) { throw new ArgumentException("此用户从未进行过实名认证"); } //if (!oldMobile.Equals(entity.Mobile)) //{ // throw new ArgumentException(string.Format("输入的旧手机号【{0}】与原有手机号不相同。", oldMobile)); //} entity.Mobile = newMobile; entity.UpdateTime = DateTime.Now; entity.UpdateBy = updateBy; manager.UpdateUserMobile(entity); } biz.CommitTran(); } }
public void UpdateBankCard(BankCardInfo bankCard, string userId) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new BankCardManager(); var entity = manager.BankCardById(userId); if (entity == null) { throw new Exception("修改信息未被查询到"); } entity.BankCardNumber = bankCard.BankCardNumber; entity.BankCode = bankCard.BankCode; entity.BankName = bankCard.BankName; entity.BankSubName = bankCard.BankSubName; entity.CityName = bankCard.CityName; entity.ProvinceName = bankCard.ProvinceName; entity.RealName = bankCard.RealName; entity.UpdateTime = DateTime.Now; manager.UpdateBankCard(entity); biz.CommitTran(); } }
public void UpdateAuthenticationMobile(string authFrom, string userId, string mobile, string updateBy) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new UserMobileManager()) { var other = manager.GetOtherUserMobile(mobile, userId); if (other != null) { throw new ArgumentException(string.Format("此手机号【{0}】已被其他用户认证。", mobile)); } var entity = manager.GetUserMobile(userId); if (entity == null) { throw new ArgumentException("此用户从未进行过手机认证"); } entity.AuthFrom = authFrom; entity.Mobile = mobile; entity.UpdateBy = updateBy; entity.IsSettedMobile = true; manager.UpdateUserMobile(entity); } biz.CommitTran(); } }
public void IssuseOpen(string gameCode, string issuseNumber) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new LotteryGameManager(); var issuse = manager.QueryGameIssuse(gameCode, issuseNumber); if (!string.IsNullOrEmpty(issuse.WinNumber)) { throw new Exception(string.Format("{0}第{1}期已有开奖号", gameCode, issuseNumber)); } if (issuse.Status != IssuseStatus.OnSale) { throw new Exception(string.Format("{0}第{1}期奖期状态不正确 -应该是OnSale,而实际是: {2}", gameCode, issuseNumber, issuse.Status.ToString())); } if (issuse.Status == IssuseStatus.Awarded) { throw new Exception("已开奖"); } issuse.Status = IssuseStatus.Awarded; manager.UpdateGameIssuse(issuse); biz.CommitTran(); } }
/// <summary> /// 更新插件信息 /// </summary> public void UpdatePluginClass(PluginClassInfo pluginClass, int id) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new PluginClassManager(); var entity = manager.QueryPluginClassById(id); if (entity == null) { throw new Exception("插件信息未被查询到"); } entity.AssemblyFileName = pluginClass.AssemblyFileName; entity.ClassName = pluginClass.ClassName; entity.EndTime = pluginClass.EndTime; entity.InterfaceName = pluginClass.InterfaceName; entity.IsEnable = pluginClass.IsEnable; entity.OrderIndex = pluginClass.OrderIndex; entity.StartTime = pluginClass.StartTime; manager.UpdatePluginClass(entity); biz.CommitTran(); } BusinessHelper.ClearPlugin(); }
public void UpdateArticle(string articleId, ArticleInfo_Add article) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new ArticleManager()) { var entity = manager.GetArticleById(articleId); if (entity == null) { throw new ArgumentException("指定编号的文章不存在"); } var keyWordsList = manager.QuerKeywordOfArticle(); var content = DeepReplaceContent(article.Description, keyWordsList); var tagList = new List <string>(); tagList.Add("script"); content = UsefullHelper.ReplaceHtmlTag(content, tagList); entity.Title = article.Title; entity.KeyWords = article.KeyWords; entity.DescContent = article.DescContent; entity.GameCode = article.GameCode; entity.Description = content; entity.IsRedTitle = article.IsRedTitle; entity.Category = article.Category; entity.UpdateTime = DateTime.Now; entity.UpdateUserKey = article.CreateUserKey; entity.UpdateUserDisplayName = article.CreateUserDisplayName; manager.UpdateArticle(entity); } biz.CommitTran(); } }
/// <summary> /// 用户积分操作 /// </summary> /// <param name="info">详细信息</param> /// <param name="opraType">操作类型:100:收入,如购彩增加积分;110:支出,如兑换奖品;</param> /// <returns></returns> public bool UserIntegral(UserGetPrizeInfo info, IntegralExchangeType payType) { try { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); if (info != null && !string.IsNullOrEmpty(info.UserId)) { if (payType == IntegralExchangeType.IntegralIn || payType == IntegralExchangeType.IntegralOut)//增加积分或兑换奖品 { SaveUserIntegralDetail(info, payType); SaveUserIntegral(info, payType); if (info.OrderMoey >= 100) { GivePrizes(info);//赠送彩金 } } } biz.CommitTran(); return(true); } } catch { return(false); } }
public string ChangePassword(string userId) { var r = new Random(DateTime.Now.Millisecond); var password = r.Next(100000, 999999).ToString(); var encodePassword = Encipherment.MD5(string.Format("{0}{1}", password, _gbKey)).ToUpper(); var password_balance = r.Next(100000, 999999).ToString(); var encodePassword_balance = Encipherment.MD5(string.Format("{0}{1}", password_balance, _gbKey)).ToUpper(); using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); var loginManager = new LoginLocalManager(); var user = loginManager.GetLoginByUserId(userId); if (user == null) { throw new AuthException("用户不存在或不是本地注册用户,不能修改密码。请确定是否是通过支付宝或QQ帐号进行登录,如有疑问,请联系客服。"); } user.Password = encodePassword; loginManager.UpdateLogin(user); var balanceManage = new UserBalanceManager(); var b = balanceManage.QueryUserBalance(userId); b.Password = encodePassword_balance; balanceManage.UpdateUserBalance(b); biz.CommitTran(); } return(string.Format("{0}|{1}", password, password_balance)); }
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(); } }
public string SubmitDoubt(DoubtInfo_Add doubt) { var id = Guid.NewGuid().ToString("N"); var entity = new Doubt { Id = id, Title = doubt.Title, Description = doubt.Description, Category = doubt.Category, ShowIndex = 0, UpCount = 0, DownCount = 0, CreateTime = DateTime.Now, CreateUserKey = doubt.CreateUserKey, CreateUserDisplayName = doubt.CreateUserDisplayName, UpdateTime = DateTime.Now, UpdateUserKey = doubt.CreateUserKey, UpdateUserDisplayName = doubt.CreateUserDisplayName, }; using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new DoubtManager()) { manager.AddDoubt(entity); } biz.CommitTran(); } return(id); }
public void AddAuthenticationEmail(string authFrom, string userId, string email, string createBy) { 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(string.Format("此用户已于【{0:yyyy-MM-dd HH:mm:ss}】进行过邮箱认证", entity.CreateTime)); } entity = new UserEmail { UserId = userId, User = manager.LoadUser(userId), AuthFrom = authFrom, Email = email, IsSettedEmail = true, CreateBy = createBy, UpdateBy = createBy, }; manager.AddUserEmail(entity); var gv = new TaskListManager(); //增加成长值 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(); } }
public void UpdateArticleIndex(Dictionary <string, int> indexCollection) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new ArticleManager()) { manager.UpdateArticleIndex(indexCollection); } biz.CommitTran(); } }
public string UpdateBonusPool_CTZQ(string gameCode, string gameType, string issuseNumber, out int totalBonusCount) { var winNumber = ""; var bonusPoolList = GetBonusPoolList_CTZQ(gameCode, gameType, issuseNumber); totalBonusCount = bonusPoolList.Sum(b => b.BonusCount); using (var tran = new GameBizBusinessManagement()) { tran.BeginTran(); var bonusManager = new Ticket_BonusManager(); foreach (var info in bonusPoolList) { //string errMsg; //var analyzer = AnalyzerFactory.GetWinNumberAnalyzer(gameCode, gameType); //if (!analyzer.CheckWinNumber(info.MatchResult, out errMsg)) //{ // throw new FormatException(errMsg); //} winNumber = info.MatchResult; var entity = bonusManager.GetBonusPool(gameCode, gameType, issuseNumber, info.BonusLevel); if (entity == null) { entity = new Ticket_BonusPool { Id = info.Id, GameCode = gameCode, GameType = gameType, IssuseNumber = info.IssuseNumber, BonusLevel = info.BonusLevel, BonusCount = info.BonusCount, BonusLevelDisplayName = info.BonusLevelDisplayName, BonusMoney = info.BonusMoney, WinNumber = info.MatchResult, CreateTime = DateTime.Parse(info.CreateTime), }; bonusManager.AddBonusPool(entity); } else { entity.BonusCount = info.BonusCount; entity.BonusLevelDisplayName = info.BonusLevelDisplayName; entity.BonusMoney = info.BonusMoney; entity.WinNumber = info.MatchResult; entity.CreateTime = DateTime.Parse(info.CreateTime); bonusManager.UpdateBonusPool(entity); } } tran.CommitTran(); } return(winNumber); }
public void UpdateDisplayName(string userId, string newDisplayName) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new UserBalanceManager()) { var user = manager.GetUserRegister(userId); user.DisplayName = newDisplayName; manager.UpdateUserRegister(user); } biz.CommitTran(); } }
public void ChangeUserHideDisplayNameCount(string userId, int hideDisplayNameCount) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new UserBalanceManager()) { var user = manager.GetUserRegister(userId); user.HideDisplayNameCount = hideDisplayNameCount; manager.UpdateUserRegister(user); } biz.CommitTran(); } }
/// <summary> /// 订单手工返钱 /// </summary> public void ManualPayForOrder(string orderId, decimal money, string msg, string requestBy) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new SchemeManager(); var orderDetail = manager.QueryOrderDetail(orderId); var fundBiz = new FundBusiness(); fundBiz.ManualHandleMoney(orderId, orderId, money, AccountType.Bonus, PayType.Payin, orderDetail.UserId, string.Format("订单{0}手工返钱{1:N2}元,{2}", orderId, money, msg)); biz.CommitTran(); } }
/// <summary> /// 修改公告 /// </summary> public void UpdateBulletin(long id, BulletinInfo_Publish bulletin, string updateBy) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var bulletinManager = new BulletinManager()) { var entity = bulletinManager.GetBulletinById(id); ObjectConvert.ConverInfoToEntity <BulletinInfo_Publish, Bulletin>(bulletin, ref entity); entity.UpdateBy = updateBy; bulletinManager.UpdateBulletin(entity); } biz.CommitTran(); } }
public void UpdateBulletinStatus(long id, EnableStatus status, string updateBy) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var bulletinManager = new BulletinManager()) { var entity = bulletinManager.GetBulletinById(id); entity.Status = status; entity.UpdateBy = updateBy; bulletinManager.UpdateBulletin(entity); } biz.CommitTran(); } }
// 根据手机号查询手机号是否存在 public void RequestAuthenticationMobileIndex(string mobile) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new UserMobileManager()) { var other = manager.GetOtherUserMobileIndex(mobile); if (other != null && other.IsSettedMobile) { throw new ArgumentException(string.Format("此手机号【{0}】已被其他用户认证。", mobile)); } } biz.CommitTran(); } }
public void CancelBankCard(string userId) { using (var biz = new GameBizBusinessManagement()) { biz.BeginTran(); var manager = new BankCardManager(); var entity = manager.BankCardById(userId); if (entity == null) { throw new Exception("未查到信息"); } manager.DeleteBankCard(entity); biz.CommitTran(); } }
public void HandleUserIdea(int id, string status, string updateUserId, string updateUserDisplayName, string managerReply) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new UserIdeaManager()) { var idea = manager.GetUserIdeaById(id); idea.Status = status; idea.UpdateUserId = updateUserId; idea.UpdateUserDisplayName = updateUserDisplayName; idea.ManageReply = managerReply; manager.UpdateUserIdea(idea); } biz.CommitTran(); } }
/// <summary> /// 删除站内信 /// </summary> public CommonActionResult DeleteInnerMail(string innerMailId, string userId) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); var siteBiz = new SiteMessageControllBusiness(); if (!siteBiz.IsMyInnerMail(innerMailId, userId)) { throw new SiteMessageException(string.Format("此站内信不属于指定用户。站内信:{0};用户:{1}。", innerMailId, userId)); } siteBiz.DeleteInnerMail(innerMailId, userId); biz.CommitTran(); } return(new CommonActionResult(true, "删除站内信完成。")); }
/// <summary> /// 发布公告 /// </summary> public void PublishBulletin(BulletinInfo_Publish bulletin, string createBy) { var entity = new Bulletin(); ObjectConvert.ConverInfoToEntity <BulletinInfo_Publish, Bulletin>(bulletin, ref entity); using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var bulletinManager = new BulletinManager()) { entity.CreateBy = createBy; entity.UpdateBy = createBy; bulletinManager.AddBulletin(entity); } biz.CommitTran(); } }
public void DeleteArticle(string articleId) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new ArticleManager()) { var entity = manager.GetArticleById(articleId); if (entity == null) { throw new ArgumentException("指定要删除的文章不存在"); } manager.DeleteArticle(entity); } biz.CommitTran(); } }
/// <summary> /// 每购彩100元增加成长值 /// </summary> public void ComplateTicket(string userId, string schemeId, decimal totalMoney, decimal totalErrorMoney) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); var manager = new SchemeManager(); var orderDetail = manager.QueryOrderDetail(schemeId); if (orderDetail == null || orderDetail.SchemeType == SchemeType.SaveScheme || orderDetail.SchemeType == SchemeType.SingleTreasure || orderDetail.IsVirtualOrder) { return; } //查询用户信息 var userManager = new UserBalanceManager(); var user = userManager.LoadUserRegister(orderDetail.UserId); //赠送成长值 var growthValue = GrowthValue(user.VipLevel, totalMoney); var currGrowth = manager.GetCurrDayGiveGrowth(userId); if (currGrowth >= 100)//每天赠送的成长值不能大于100 { return; } var sumGrowth = growthValue + currGrowth; if (sumGrowth > 100) { growthValue = 100 - currGrowth; } if (growthValue > 0M) { BusinessHelper.Payin_UserGrowth(BusinessHelper.FundCategory_BuyGrowthValue, schemeId, user.UserId, (int)Math.Round(growthValue), string.Format("购彩赠送成长值:{0}", (int)Math.Round(growthValue))); } //赠送豆豆 var doudou = GetDoudou(user.VipLevel, totalMoney); if (doudou > 0M) { BusinessHelper.Payin_OCDouDou(BusinessHelper.FundCategory_BuyDouDou, schemeId, user.UserId, (int)Math.Round(doudou), string.Format("购彩赠送豆豆:{0}", (int)Math.Round(doudou))); } biz.CommitTran(); } }