public List <AddMoneyQueryInfo> QueryTotalAddMoneyList(int count) { Session.Clear(); var sql = string.Format(@"select top {0} a.GameCode,a.UserId,u.DisplayName,u.HideDisplayNameCount, a.BonusMoney,a.AddMoney,b.GainMoney from (SELECT GameCode,UserId,SUM(BonusMoney)BonusMoney,sum(AddMoney)AddMoney FROM [E_A20130114_加奖统计] group by GameCode,UserId ) AS a inner join C_User_Register u on a.UserId=u.UserId left join (select GameCode,UserId,sum(TogetherSchemeSuccessGainMoney) GainMoney from C_User_Beedings group by GameCode,UserId)AS b on a.GameCode =b.GameCode and a.UserId=b.UserId order by AddMoney desc", count); var list = new List <AddMoneyQueryInfo>(); foreach (var item in this.Session.CreateSQLQuery(sql).List()) { var array = item as object[]; list.Add(new AddMoneyQueryInfo { GameCode = UsefullHelper.GetDbValue <string>(array[0]), UserId = UsefullHelper.GetDbValue <string>(array[1]), UserDisplayName = UsefullHelper.GetDbValue <string>(array[2]), HideDisplayNameCount = UsefullHelper.GetDbValue <int>(array[3]), BonusMoney = UsefullHelper.GetDbValue <decimal>(array[4]), AddMoney = UsefullHelper.GetDbValue <decimal>(array[5]), GainMoney = UsefullHelper.GetDbValue <decimal>(array[6]), }); } return(list); }
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(); } }
public void LoadArray(object[] dataArray) { if (dataArray.Length == 21) { OrderId = UsefullHelper.GetDbValue <string>(dataArray[0]); RequesterDisplayName = UsefullHelper.GetDbValue <string>(dataArray[1]); RequesterUserKey = UsefullHelper.GetDbValue <string>(dataArray[2]); RequesterComeFrom = UsefullHelper.GetDbValue <string>(dataArray[3]); ProcessorsDisplayName = UsefullHelper.GetDbValue <string>(dataArray[4]); ProcessorsUserKey = UsefullHelper.GetDbValue <string>(dataArray[5]); WithdrawAgent = UsefullHelper.GetDbValue <WithdrawAgentType>(dataArray[6]); ProvinceName = UsefullHelper.GetDbValue <string>(dataArray[7]); CityName = UsefullHelper.GetDbValue <string>(dataArray[8]); BankCode = UsefullHelper.GetDbValue <string>(dataArray[9]); BankName = UsefullHelper.GetDbValue <string>(dataArray[10]); BankSubName = UsefullHelper.GetDbValue <string>(dataArray[11]); BankCardNumber = UsefullHelper.GetDbValue <string>(dataArray[12]); RequestMoney = UsefullHelper.GetDbValue <decimal>(dataArray[13]); RequestTime = UsefullHelper.GetDbValue <DateTime>(dataArray[14]); Status = UsefullHelper.GetDbValue <WithdrawStatus>(dataArray[15]); ResponseMoney = UsefullHelper.GetDbValue <decimal?>(dataArray[16]); ResponseMessage = UsefullHelper.GetDbValue <string>(dataArray[17]); ResponseTime = UsefullHelper.GetDbValue <DateTime?>(dataArray[18]); RequesterRealName = UsefullHelper.GetDbValue <string>(dataArray[19]); RequesterMobile = UsefullHelper.GetDbValue <string>(dataArray[20]); } else { throw new ArgumentException("数据数组长度不满足要求,不能转换成此Withdraw_QueryInfo对象,传入数组为" + dataArray.Length + "。" + string.Join(", ", dataArray), "dataArray"); } }
public AgentWithdrawRecordCollection GetAgentWithdrawRecord(string userId, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize) { Session.Clear(); int totalCount = 0; pageIndex = pageIndex < 0 ? 0 : pageIndex; pageSize = pageSize > BusinessHelper.MaxPageSize ? BusinessHelper.MaxPageSize : pageSize; Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_Agent_GetWithdrawRecord")); query = query.AddInParameter("userId", userId); query = query.AddInParameter("fromDate", fromDate); query = query.AddInParameter("toDate", toDate); query = query.AddInParameter("pageIndex", pageIndex); query = query.AddInParameter("pageSize", pageSize); query = query.AddOutParameter("totalCount", "Int32"); var ds = query.GetDataSet(out outputs); totalCount = UsefullHelper.GetDbValue <int>(outputs["totalCount"]); var list = ORMHelper.DataTableToList <AgentWithdrawRecordInfo>(ds.Tables[0]); var requestingMoney = UsefullHelper.GetDbValue <decimal>(ds.Tables[1].Rows[0]["RequestingMoney"]); var successMoney = UsefullHelper.GetDbValue <decimal>(ds.Tables[1].Rows[0]["SuccessMoney"]); var refusedMoney = UsefullHelper.GetDbValue <decimal>(ds.Tables[1].Rows[0]["RefusedMoney"]); return(new AgentWithdrawRecordCollection() { AgentWithdrawRecordList = list, TotalCount = totalCount, RequestingMoney = requestingMoney, SuccessMoney = successMoney, RefusedMoney = refusedMoney }); }
public IList <AgentSchemeInfo> GetAgentScheme(string agentId, string userId, string displayName, int progressStatus, int ticketStatus , DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, out int totalCount, out int totalUser, out int totalScheme, out decimal totalMoney1) { Session.Clear(); pageIndex = pageIndex < 0 ? 0 : pageIndex; pageSize = pageSize > BusinessHelper.MaxPageSize ? BusinessHelper.MaxPageSize : pageSize; Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_Agent_GetScheme")); query = query.AddInParameter("agentId", agentId); query = query.AddInParameter("userId", userId); query = query.AddInParameter("displayName", displayName); query = query.AddInParameter("progressStatus", progressStatus); query = query.AddInParameter("ticketStatus", ticketStatus); query = query.AddInParameter("fromDate", fromDate); query = query.AddInParameter("toDate", toDate); query = query.AddInParameter("pageIndex", pageIndex); query = query.AddInParameter("pageSize", pageSize); query = query.AddOutParameter("totalCount", "Int32"); var ds = query.GetDataSet(out outputs); totalCount = UsefullHelper.GetDbValue <int>(outputs["totalCount"]); totalUser = UsefullHelper.GetDbValue <int>(ds.Tables[1].Rows[0]["TotalUser"]); totalScheme = UsefullHelper.GetDbValue <int>(ds.Tables[1].Rows[0]["TotalScheme"]); totalMoney1 = UsefullHelper.GetDbValue <decimal>(ds.Tables[1].Rows[0]["TotalMoney1"]); return(ORMHelper.DataTableToList <AgentSchemeInfo>(ds.Tables[0])); }
internal void LoadArray(object[] dataArray) { if (dataArray.Length == 19) { Id = (string)dataArray[0]; GameCode = (string)dataArray[1]; Title = (string)dataArray[2]; Category = (string)dataArray[3]; ShowIndex = (int)dataArray[4]; ReadCount = (int)dataArray[5]; CreateTime = (DateTime)dataArray[6]; CreateUserKey = (string)dataArray[7]; CreateUserDisplayName = (string)dataArray[8]; UpdateTime = (DateTime)dataArray[9]; UpdateUserKey = (string)dataArray[10]; UpdateUserDisplayName = (string)dataArray[11]; IsRedTitle = (bool)dataArray[12]; KeyWords = UsefullHelper.GetDbValue <string>(dataArray[13]); DescContent = UsefullHelper.GetDbValue <string>(dataArray[14]); StaticPath = UsefullHelper.GetDbValue <string>(dataArray[15]); PreStaticPath = UsefullHelper.GetDbValue <string>(dataArray[16]); NextStaticPath = UsefullHelper.GetDbValue <string>(dataArray[17]); Description = UsefullHelper.GetDbValue <string>(dataArray[18]); } else { throw new ArgumentException("转换成此ArticleInfo_Query对象的数据数组长度不正确,传入数组为" + dataArray.Length + "。" + string.Join(", ", dataArray), "dataArray"); } }
public void CancelAttention_AfterTranCommit(string activeUserId, string passiveUserId) { UsefullHelper.TryDoAction(() => UpdateProfileAttention_Active(activeUserId, passiveUserId, -1)); UsefullHelper.TryDoAction(() => UpdateProfileAttention_Passive(activeUserId, passiveUserId, -1)); UsefullHelper.TryDoAction(() => UpdateProfileUserInfo(activeUserId, null, null, null, -1, null, null)); UsefullHelper.TryDoAction(() => UpdateProfileUserInfo(passiveUserId, null, null, null, null, -1, null)); }
public void User_AfterLogin(string userId, string loginFrom, string loginIp, DateTime loginTime) { new Thread(() => { // 更新用户登录日志,忽略异常,异常只记录日志 UsefullHelper.TryDoAction(() => UpdateUserLoginHistory(userId, loginFrom, loginIp, loginTime)); }).Start(); }
public object ExecPlugin(string type, object inputParam) { UsefullHelper.TryDoAction(() => { var paraList = inputParam as object[]; switch (type) { case "ICreateTogether_AfterTranCommit": CreateTogether_AfterTranCommit((string)paraList[0], (string)paraList[1], (string)paraList[2], (string)paraList[3], (string)paraList[4], (decimal)paraList[5], (DateTime)paraList[6]); break; case "IBettingSport_AfterTranCommit": BettingSport_AfterTranCommit((string)paraList[0], (Sports_BetingInfo)paraList[1], (string)paraList[2]); break; case "IBettingLottery_AfterTranCommit": BettingLottery_AfterTranCommit((string)paraList[0], (LotteryBettingInfo)paraList[1], (string)paraList[2], (string)paraList[3]); break; case "IJoinTogether_AfterTranCommit": JoinTogether_AfterTranCommit((string)paraList[0], (string)paraList[1], (int)paraList[2], (string)paraList[3], (string)paraList[4], (string)paraList[5], (decimal)paraList[6], (TogetherSchemeProgress)paraList[7]); break; case "IUser_AfterLogin": User_AfterLogin((string)paraList[0], (string)paraList[1], (string)paraList[2], (DateTime)paraList[3]); break; case "IOrderPrize_AfterTranCommit": OrderPrize_AfterTranCommit((string)paraList[0], (string)paraList[1], (string)paraList[2], (string)paraList[3], (string)paraList[4], (decimal)paraList[5], (bool)paraList[6], (decimal)paraList[7], (decimal)paraList[8], (bool)paraList[9], (DateTime)paraList[10]); break; case "ITogetherFollow_AfterTranCommit": TogetherFollow_AfterTranCommit((TogetherFollowerRuleInfo)paraList[0]); break; case "IExistTogetherFollow_AfterTranCommit": ExistTogetherFollow_AfterTranCommit((string)paraList[0], (string)paraList[1], (string)paraList[2], (string)paraList[3]); break; case "IAttention_AfterTranCommit": Attention_AfterTranCommit((string)paraList[0], (string)paraList[1]); break; case "ICancelAttention_AfterTranCommit": CancelAttention_AfterTranCommit((string)paraList[0], (string)paraList[1]); break; case "IChangeHideDisplayNameCount_AfterTranCommit": ChangeHideDisplayNameCount_AfterTranCommit((string)paraList[0], (int)paraList[1]); break; default: throw new ArgumentOutOfRangeException("不支持的插件类型 - " + type); } }); return(null); }
public string SubmitArticle(ArticleInfo_Add article) { var id = BusinessHelper.GetArticleId(); var manager = new ArticleManager(); var keyWordsList = manager.QuerKeywordOfArticle(); var content = DeepReplaceContent(article.Description, keyWordsList); var tagList = new List <string>(); tagList.Add("script"); content = UsefullHelper.ReplaceHtmlTag(content, tagList); var staticPath = string.Format("/statichtml/zixun/details/{0}/{1}.html", DateTime.Now.ToString("yyyyMMdd"), id); var lastId = string.Empty; var lastTitle = string.Empty; var lastStaticPath = string.Empty; var last = manager.QueryLastArticle(article.Category); if (last != null) { lastId = last.Id; lastTitle = last.Title.Length > 50 ? last.Title.Substring(0, 50) : last.Title; lastStaticPath = last.StaticPath; last.NextId = id; last.NextTitle = article.Title.Length > 50 ? article.Title.Substring(0, 50) : article.Title; last.NextStaticPath = staticPath; manager.UpdateArticle(last); } var entity = new Article { Id = id, GameCode = article.GameCode, Title = article.Title, KeyWords = article.KeyWords, DescContent = article.DescContent, Description = content, IsRedTitle = article.IsRedTitle, Category = article.Category, ShowIndex = 0, ReadCount = 0, CreateTime = DateTime.Now, CreateUserKey = article.CreateUserKey, CreateUserDisplayName = article.CreateUserDisplayName, UpdateTime = DateTime.Now, UpdateUserKey = article.CreateUserKey, UpdateUserDisplayName = article.CreateUserDisplayName, PreId = lastId, PreTitle = lastTitle, PreStaticPath = lastStaticPath, StaticPath = "", }; manager.AddArticle(entity); return(id); }
public TotalSingleTreasure_Collection QueryBDFXAutherHomePage(string userId, string strIsBonus, string currentTime, int pageIndex, int pageSize) { Session.Clear(); TotalSingleTreasure_Collection collection = new TotalSingleTreasure_Collection(); collection.TotalCount = 0; Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_QueryBDFXAutherHomePage")) .AddInParameter("UserId", userId) .AddInParameter("StrIsBonus", strIsBonus) .AddInParameter("CurrentTime", currentTime) .AddInParameter("PageIndex", pageIndex) .AddInParameter("PageSize", pageSize) .AddOutParameter("TotalCount", "Int32") .AddOutParameter("AllTotalBuyCount", "Int32") .AddOutParameter("AllTotalBonusMoney", "Int32"); var dt = query.GetDataTable(out outputs); collection.TotalCount = UsefullHelper.GetDbValue <int>(outputs["TotalCount"]); collection.AllTotalBuyCount = UsefullHelper.GetDbValue <int>(outputs["AllTotalBuyCount"]); collection.AllTotalBonusMoney = UsefullHelper.GetDbValue <int>(outputs["AllTotalBonusMoney"]); if (collection.TotalCount > 0) { foreach (DataRow row in dt.Rows) { TotalSingleTreasureInfo info = new TotalSingleTreasureInfo(); info.UserId = Convert.ToString(row["UserId"]); info.UserName = Convert.ToString(row["UserName"]); info.SingleTreasureDeclaration = Convert.ToString(row["SingleTreasureDeclaration"]); info.GameCode = Convert.ToString(row["GameCode"]); info.GameType = Convert.ToString(row["GameType"]); info.IssuseNumber = Convert.ToString(row["IssuseNumber"]); info.ExpectedReturnRate = Convert.ToDecimal(row["ExpectedReturnRate"]); info.Commission = Convert.ToDecimal(row["Commission"]); info.Security = (TogetherSchemeSecurity)Convert.ToInt32(row["Security"]); info.TotalBuyCount = Convert.ToInt32(row["TotalBuyCount"]); info.TotalBuyMoney = Convert.ToDecimal(row["TotalBuyMoney"]); info.AfterTaxBonusMoney = Convert.ToDecimal(row["AfterTaxBonusMoney"]); info.FirstMatchStopTime = Convert.ToDateTime(row["FirstMatchStopTime"]); info.LastMatchStopTime = Convert.ToDateTime(row["LastMatchStopTime"]); info.ProfitRate = Convert.ToDecimal(row["ProfitRate"]); info.SchemeId = Convert.ToString(row["SchemeId"]); info.TotalBonusMoney = Convert.ToDecimal(row["TotalBonusMoney"]); info.ExpectedBonusMoney = Convert.ToDecimal(row["ExpectedBonusMoney"]); info.BetCount = Convert.ToInt32(row["BetCount"]); info.TotalMatchCount = Convert.ToInt32(row["TotalMatchCount"]); info.IsComplate = Convert.ToBoolean(row["IsComplate"]); info.CurrentBetMoney = Convert.ToDecimal(row["CurrentBetMoney"]); info.CurrProfitRate = row["CurrProfitRate"] == DBNull.Value ? 0M : Convert.ToDecimal(row["CurrProfitRate"]); collection.TotalSingleTreasureList.Add(info); } var arrSchemeId = from o in collection.TotalSingleTreasureList select o.SchemeId; var anteCodeList = this.QueryAnteCodeList(arrSchemeId.ToArray()); collection.AnteCodeList.AddRange(anteCodeList); } return(collection); }
/// <summary> /// 未返点方案 /// </summary> public List <SubUserNoPayRebateOrderInfo> QuerySubUserNoPayRebateOrderList(string key, string userId, DateTime starTime, DateTime endTime, int pageIndex, int pageSize, out int totalCount, out int totalUserCount, out decimal totalMoney) { starTime = starTime.Date; endTime = endTime.AddDays(1).Date; Session.Clear(); // 通过数据库存储过程进行查询 Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_Agent_QuerySubUserNoPayRebateOrderList")) .AddInParameter("key", key) .AddInParameter("agentId", userId) .AddInParameter("starTime", starTime) .AddInParameter("endTime", endTime) .AddInParameter("pageIndex", pageIndex) .AddInParameter("pageSize", pageSize) .AddOutParameter("totalCount", "Int32") .AddOutParameter("totalUserCount", "Int32") .AddOutParameter("totalMoney", "Decimal"); var list = query.List(out outputs); totalCount = UsefullHelper.GetDbValue <int>(outputs["totalCount"]); totalUserCount = UsefullHelper.GetDbValue <int>(outputs["totalUserCount"]); totalMoney = UsefullHelper.GetDbValue <decimal>(outputs["totalMoney"]); var result = new List <SubUserNoPayRebateOrderInfo>(); foreach (var item in list) { var array = item as object[]; SubUserNoPayRebateOrderInfo info = new SubUserNoPayRebateOrderInfo(); info.UserId = Convert.ToString(array[1]); info.DisplayName = Convert.ToString(array[2]); info.SchemeId = Convert.ToString(array[3]); info.Progress = Convert.ToDecimal(array[4]); info.GameCode = Convert.ToString(array[5]); info.TotalMonery = Convert.ToDecimal(array[6]); info.CreateTime = Convert.ToDateTime(array[7]); info.HideDisplayNameCount = Convert.ToInt32(array[8]); result.Add(info); //result.Add(new SubUserNoPayRebateOrderInfo //{ // UserId = UsefullHelper.GetDbValue<string>(array[1]), // DisplayName = UsefullHelper.GetDbValue<string>(array[2]), // SchemeId = UsefullHelper.GetDbValue<string>(array[3]), // Progress = UsefullHelper.GetDbValue<decimal>(array[4]), // GameCode = UsefullHelper.GetDbValue<string>(array[5]), // TotalMonery = UsefullHelper.GetDbValue<decimal>(array[6]), // CreateTime = UsefullHelper.GetDbValue<DateTime>(array[7]), // HideDisplayNameCount=Convert.ToInt32(array[8]), //}); } return(result); }
public void JoinTogether_AfterTranCommit(string userId, string schemeId, int buyCount, string gameCode, string gameType, string issuseNumber, decimal totalMoney, TogetherSchemeProgress progress) { // 更新最新动态,忽略异常,异常只记录日志 var desc = string.Format("参与了 {0}第{1}期¥{2:N0}的合买方案 参与{3}元", GetGameName(gameCode, gameType), issuseNumber, totalMoney, buyCount); UsefullHelper.TryDoAction(() => UpdateProfileDynamic(userId, schemeId, gameCode, issuseNumber, buyCount, "参与合买")); // 更新统计数据 UsefullHelper.TryDoAction(() => UpdateProfileDataReport(userId, null, 1, null, null)); //普通用户推广 UsefullHelper.TryDoAction(() => UpdateSporeadUserData(userId, gameCode, totalMoney)); //分享推广活动 用户购彩了 送红包 只送一次 //UsefullHelper.TryDoAction(() => FirstLotteryGiveRedBag(userId)); }
public void BettingSport_AfterTranCommit(string userId, Sports_BetingInfo bettingOrder, string schemeId) { // 更新最新动态,忽略异常,异常只记录日志 var desc = string.Format("代购了 {0}第{1}期¥{2:N0} 投注方案", GetGameName(bettingOrder.GameCode, bettingOrder.GameType), bettingOrder.IssuseNumber, bettingOrder.TotalMoney); UsefullHelper.TryDoAction(() => UpdateProfileDynamic(userId, schemeId, bettingOrder.GameCode, bettingOrder.IssuseNumber, bettingOrder.TotalMoney, "代购")); // 更新统计数据 UsefullHelper.TryDoAction(() => UpdateProfileDataReport(userId, 1, null, null, null)); //普通用户推广 UsefullHelper.TryDoAction(() => UpdateSporeadUserData(userId, bettingOrder.GameCode, bettingOrder.TotalMoney)); //分享推广活动 用户购彩了 送红包 只送一次 //UsefullHelper.TryDoAction(() => FirstLotteryGiveRedBag(userId)); }
public void CreateTogether_AfterTranCommit(string userId, string schemeId, string gameCode, string gameType, string issuseNumber, decimal totalMoney, DateTime stopTime) { // 更新超级发起人状态,忽略异常,异常只记录日志 //UsefullHelper.TryDoAction(() => UpdateSupperTogetherScheme(userId, stopTime)); // 更新最新动态,写入数据库 UsefullHelper.TryDoAction(() => UpdateProfileDynamic(userId, schemeId, gameCode, issuseNumber, totalMoney, "发起合买")); // 更新统计数据 UsefullHelper.TryDoAction(() => UpdateProfileDataReport(userId, 1, null, null, null)); //普通用户推广 UsefullHelper.TryDoAction(() => UpdateSporeadUserData(userId, gameCode, totalMoney)); //分享推广活动 用户购彩了 送红包 只送一次 //UsefullHelper.TryDoAction(() => FirstLotteryGiveRedBag(userId)); }
public void OrderPrize_AfterTranCommit(string userId, string schemeId, string gameCode, string gameType, string issuseNumber, decimal orderMoney, bool isBonus, decimal preTaxBonusMoney, decimal afterTaxBonusMoney, bool isVirtualOrder, DateTime prizeTime) { if (isBonus) { // 更新用户获奖级别统计,忽略异常,异常只记录日志 UsefullHelper.TryDoAction(() => UpdateProfileBonusLevel(userId, afterTaxBonusMoney)); // 更新最新动态,忽略异常,异常只记录日志 UsefullHelper.TryDoAction(() => UpdateProfileDynamic(userId, schemeId, gameCode, issuseNumber, orderMoney, string.Format("用户订单:{0}中奖", schemeId))); // 更新最新中奖,忽略异常,异常只记录日志 UsefullHelper.TryDoAction(() => AddProfileLastBonus(userId, schemeId, gameCode, gameType, issuseNumber, afterTaxBonusMoney, prizeTime)); // 更新历史战绩,忽略异常,异常只记录日志 UsefullHelper.TryDoAction(() => UpdateProfileBeedings(userId, gameCode, gameType, orderMoney, afterTaxBonusMoney, isVirtualOrder, prizeTime)); // 更新统计数据 UsefullHelper.TryDoAction(() => UpdateProfileDataReport(userId, null, null, 1, afterTaxBonusMoney)); } }
/// <summary> /// 申请结算佣金 /// </summary> public void AddAgentCommissionApply(DateTime toDate, decimal deduction, string agentId) { var manager = new AgentManager(); var applyTime = GetCommissionApplyTime(agentId); if (toDate > applyTime[1]) { throw new Exception("结算时间不能大于" + applyTime[1].ToString("yyyy-MM-dd")); } if (toDate < applyTime[0]) { throw new Exception("结算时间不能小于" + applyTime[0].ToString("yyyy-MM-dd")); } decimal commission = 0; decimal dealSale = 0; var agentCommissionApplyList = manager.GetCommissionReportByFromTimeAndToDateAndPAgentId(applyTime[0], toDate.AddDays(+1), agentId, 0); if (agentCommissionApplyList.Count > 0) { foreach (var item in agentCommissionApplyList) { item.ApplyState = 1; } commission = agentCommissionApplyList.Sum(o => o.BeforeCommission); commission = commission * (100 - deduction) / 100; dealSale = agentCommissionApplyList.Sum(o => o.Sale); } manager.UpdateAgentCommissionDetail(agentCommissionApplyList); manager.AddAgentCommissionApply(new AgentCommissionApply() { ID = UsefullHelper.UUID(), RequestTime = DateTime.Now, FromTime = applyTime[0], ToTime = toDate, RequestUserId = agentId, RequestCommission = commission, ResponseCommission = null, ResponseUserId = null, DealSale = dealSale, ResponseTime = null, ApplyState = 1, Remark = null }); }
public List <JCZQMatchResult> QueryJCZQMatchResult(DateTime startTime, DateTime endTime, int pageIndex, int pageSize, out int totalCount) { Session.Clear(); pageIndex = pageIndex < 0 ? 0 : pageIndex; pageSize = pageSize > BusinessHelper.MaxPageSize ? BusinessHelper.MaxPageSize : pageSize; var query = from r in this.Session.Query <JCZQ_MatchResult>() join m in this.Session.Query <JCZQ_Match>() on r.MatchId equals m.MatchId where r.CreateTime >= startTime && r.CreateTime < endTime.AddDays(1) && (r.SPF_SP != 1M && r.BRQSPF_SP != 1M && r.ZJQ_SP != 1M && r.BF_SP != 1M && r.BQC_SP != 1M) orderby r.MatchId descending select new JCZQMatchResult { MatchId = UsefullHelper.GetDbValue <string>(m.MatchId), MatchIdName = UsefullHelper.GetDbValue <string>(m.MatchIdName), StartTime = UsefullHelper.GetDbValue <DateTime>(m.StartDateTime), LeagueId = UsefullHelper.GetDbValue <int>(m.LeagueId), LeagueName = UsefullHelper.GetDbValue <string>(m.LeagueName), LeagueColor = UsefullHelper.GetDbValue <string>(m.LeagueColor), HomeTeamId = UsefullHelper.GetDbValue <int>(m.HomeTeamId), HomeTeamName = UsefullHelper.GetDbValue <string>(m.HomeTeamName), GuestTeamId = UsefullHelper.GetDbValue <int>(m.GuestTeamId), GuestTeamName = UsefullHelper.GetDbValue <string>(m.GuestTeamName), LetBall = UsefullHelper.GetDbValue <int>(m.LetBall), WinOdds = UsefullHelper.GetDbValue <decimal>(m.WinOdds), FlatOdds = UsefullHelper.GetDbValue <decimal>(m.FlatOdds), LoseOdds = UsefullHelper.GetDbValue <decimal>(m.LoseOdds), MatchState = UsefullHelper.GetDbValue <string>(r.MatchState), HalfHomeTeamScore = UsefullHelper.GetDbValue <int>(r.HalfHomeTeamScore), HalfGuestTeamScore = UsefullHelper.GetDbValue <int>(r.HalfGuestTeamScore), FullHomeTeamScore = UsefullHelper.GetDbValue <int>(r.FullHomeTeamScore), FullGuestTeamScore = UsefullHelper.GetDbValue <int>(r.FullGuestTeamScore), SPF_Result = UsefullHelper.GetDbValue <string>(r.SPF_Result), SPF_SP = UsefullHelper.GetDbValue <decimal>(r.SPF_SP), BRQSPF_Result = UsefullHelper.GetDbValue <string>(r.BRQSPF_Result), BRQSPF_SP = UsefullHelper.GetDbValue <decimal>(r.BRQSPF_SP), ZJQ_Result = UsefullHelper.GetDbValue <string>(r.ZJQ_Result), ZJQ_SP = UsefullHelper.GetDbValue <decimal>(r.ZJQ_SP), BF_Result = UsefullHelper.GetDbValue <string>(r.BF_Result), BF_SP = UsefullHelper.GetDbValue <decimal>(r.BF_SP), BQC_Result = UsefullHelper.GetDbValue <string>(r.BQC_Result), BQC_SP = UsefullHelper.GetDbValue <decimal>(r.BQC_SP), CreateTime = UsefullHelper.GetDbValue <DateTime>(r.CreateTime), }; totalCount = query.Count(); return(query.Skip(pageIndex * pageSize).Take(pageSize).ToList()); }
public void BettingLottery_AfterTranCommit(string userId, LotteryBettingInfo bettingOrder, string schemeId, string keyLine) { // 更新最新动态,忽略异常,异常只记录日志 if (bettingOrder.IssuseNumberList.Count > 1) { UsefullHelper.TryDoAction(() => UpdateProfileDynamic(userId, schemeId, bettingOrder.GameCode, bettingOrder.IssuseNumberList[0].IssuseNumber, bettingOrder.TotalMoney, "代购")); } else { UsefullHelper.TryDoAction(() => UpdateProfileDynamic(userId, schemeId, bettingOrder.GameCode, bettingOrder.IssuseNumberList[0].IssuseNumber, bettingOrder.TotalMoney, "代购")); } // 更新统计数据 UsefullHelper.TryDoAction(() => UpdateProfileDataReport(userId, 1, null, null, null)); //普通用户推广 UsefullHelper.TryDoAction(() => UpdateSporeadUserData(userId, bettingOrder.GameCode, bettingOrder.TotalMoney)); //分享推广活动 用户购彩了 送红包 只送一次 //UsefullHelper.TryDoAction(() => FirstLotteryGiveRedBag(userId)); }
public List <JCZQMatchResult> QueryJCZQMatchResult(DateTime time) { Session.Clear(); var query = from r in this.Session.Query <JCZQ_MatchResult>() join m in this.Session.Query <JCZQ_Match>() on r.MatchId equals m.MatchId where r.CreateTime >= time && r.CreateTime < time.AddDays(1) && (r.SPF_SP != 1M && r.BRQSPF_SP != 1M && r.ZJQ_SP != 1M && r.BF_SP != 1M && r.BQC_SP != 1M) orderby r.MatchId descending select new JCZQMatchResult { MatchId = UsefullHelper.GetDbValue <string>(m.MatchId), MatchIdName = UsefullHelper.GetDbValue <string>(m.MatchIdName), StartTime = UsefullHelper.GetDbValue <DateTime>(m.StartDateTime), LeagueId = UsefullHelper.GetDbValue <int>(m.LeagueId), LeagueName = UsefullHelper.GetDbValue <string>(m.LeagueName), LeagueColor = UsefullHelper.GetDbValue <string>(m.LeagueColor), HomeTeamId = UsefullHelper.GetDbValue <int>(m.HomeTeamId), HomeTeamName = UsefullHelper.GetDbValue <string>(m.HomeTeamName), GuestTeamId = UsefullHelper.GetDbValue <int>(m.GuestTeamId), GuestTeamName = UsefullHelper.GetDbValue <string>(m.GuestTeamName), LetBall = UsefullHelper.GetDbValue <int>(m.LetBall), WinOdds = UsefullHelper.GetDbValue <decimal>(m.WinOdds), FlatOdds = UsefullHelper.GetDbValue <decimal>(m.FlatOdds), LoseOdds = UsefullHelper.GetDbValue <decimal>(m.LoseOdds), MatchState = UsefullHelper.GetDbValue <string>(r.MatchState), HalfHomeTeamScore = UsefullHelper.GetDbValue <int>(r.HalfHomeTeamScore), HalfGuestTeamScore = UsefullHelper.GetDbValue <int>(r.HalfGuestTeamScore), FullHomeTeamScore = UsefullHelper.GetDbValue <int>(r.FullHomeTeamScore), FullGuestTeamScore = UsefullHelper.GetDbValue <int>(r.FullGuestTeamScore), SPF_Result = UsefullHelper.GetDbValue <string>(r.SPF_Result), SPF_SP = UsefullHelper.GetDbValue <decimal>(r.SPF_SP), BRQSPF_Result = UsefullHelper.GetDbValue <string>(r.BRQSPF_Result), BRQSPF_SP = UsefullHelper.GetDbValue <decimal>(r.BRQSPF_SP), ZJQ_Result = UsefullHelper.GetDbValue <string>(r.ZJQ_Result), ZJQ_SP = UsefullHelper.GetDbValue <decimal>(r.ZJQ_SP), BF_Result = UsefullHelper.GetDbValue <string>(r.BF_Result), BF_SP = UsefullHelper.GetDbValue <decimal>(r.BF_SP), BQC_Result = UsefullHelper.GetDbValue <string>(r.BQC_Result), BQC_SP = UsefullHelper.GetDbValue <decimal>(r.BQC_SP), CreateTime = UsefullHelper.GetDbValue <DateTime>(r.CreateTime), }; return(query.ToList()); }
public List <TeamCommentRankingInfo> QueryTeamCommentRanking(DateTime currentDate, DateTime nextDate, int length) { Session.Clear(); var sql = string.Format(@"select top {2} c.UserId,u.DisplayName,sum(c.ByTop)ByTop from [E_TeamComment_Article] c left join C_User_Register u on c.UserId=u.UserId where c.PublishTime>'{0}' and c.PublishTime<='{1}' group by c.UserId,u.DisplayName order by ByTop desc", currentDate.ToString("yyyy-MM-dd"), nextDate.ToString("yyyy-MM-dd"), length); var result = new List <TeamCommentRankingInfo>(); var list = this.Session.CreateSQLQuery(sql).List(); foreach (var item in list) { var array = item as object[]; result.Add(new TeamCommentRankingInfo() { UserId = UsefullHelper.GetDbValue <string>(array[0]), DisplayName = UsefullHelper.GetDbValue <string>(array[1]), ByTop = UsefullHelper.GetDbValue <int>(array[2]), }); } return(result); //var query = from c in this.Session.Query<TeamComment>() // join u in this.Session.Query<UserRegister>() on c.UserId equals u.UserId // where c.PublishTime >= new DateTime(currentDate.Year, currentDate.Month, currentDate.Day) && c.PublishTime < new DateTime(nextDate.Year, nextDate.Month, nextDate.Day) // orderby c.ByTop descending // group c by new { UserId = c.UserId, DisplayName = u.DisplayName } into t // select new TeamCommentRankingInfo // { // UserId = t.Key.UserId, // DisplayName = t.Key.DisplayName, // ByTop = t.Sum(p => p.ByTop), // }; //return query.Take(length).ToList(); }
public IList <AgentWaitingCommissionOrderInfo> QueryAgentWaitingCommissionOrderList(DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, out int totalCount) { Session.Clear(); pageIndex = pageIndex < 0 ? 0 : pageIndex; pageSize = pageSize > BusinessHelper.MaxPageSize ? BusinessHelper.MaxPageSize : pageSize; Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_Agent_QueryWaitingCommissionOrderList")); query = query.AddInParameter("fromDate", fromDate); query = query.AddInParameter("toDate", toDate); query = query.AddInParameter("pageIndex", pageIndex); query = query.AddInParameter("pageSize", pageSize); query = query.AddOutParameter("totalCount", "Int32"); var dt = query.GetDataTable(out outputs); totalCount = UsefullHelper.GetDbValue <int>(outputs["totalCount"]); return(ORMHelper.DataTableToList <AgentWaitingCommissionOrderInfo>(dt)); }
/// <summary> /// 查询代理用户 /// </summary> public IList <AgentUserInfo> GetAgentUserByKeyword(string keyword, int isAgent, string pAgentId, int pageIndex, int pageSize, out int totalCount) { Session.Clear(); pageIndex = pageIndex < 0 ? 0 : pageIndex; pageSize = pageSize > BusinessHelper.MaxPageSize ? BusinessHelper.MaxPageSize : pageSize; Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_Agent_QueryUserList")); query = query.AddInParameter("keyword", keyword); query = query.AddInParameter("pAgentId", pAgentId); query = query.AddInParameter("isAgent", isAgent); query = query.AddInParameter("pageIndex", pageIndex); query = query.AddInParameter("pageSize", pageSize); query = query.AddOutParameter("totalCount", "Int32"); var dt = query.GetDataTable(out outputs); totalCount = UsefullHelper.GetDbValue <int>(outputs["totalCount"]); return(ORMHelper.DataTableToList <AgentUserInfo>(dt)); }
public IList <AgentCommissionDetailInfo> GetAgentCommissionDetailList(string pAgentId, string userId, string displayName, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, int applyState, out int totalCount) { Session.Clear(); pageIndex = pageIndex < 0 ? 0 : pageIndex; pageSize = pageSize > BusinessHelper.MaxPageSize ? BusinessHelper.MaxPageSize : pageSize; Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_Agent_QueryCommissionDetailList")); query = query.AddInParameter("fromDate", fromDate); query = query.AddInParameter("toDate", toDate); query = query.AddInParameter("pAgentId", pAgentId); query = query.AddInParameter("userId", userId); query = query.AddInParameter("displayName", displayName); query = query.AddInParameter("pageIndex", pageIndex); query = query.AddInParameter("pageSize", pageSize); query = query.AddInParameter("applyState", applyState); query = query.AddOutParameter("totalCount", "Int32"); var dt = query.GetDataTable(out outputs); totalCount = UsefullHelper.GetDbValue <int>(outputs["totalCount"]); return(ORMHelper.DataTableToList <AgentCommissionDetailInfo>(dt)); }
public List <JCLQMatchResult> QueryJCLQMatchResult(DateTime time) { Session.Clear(); var query = from r in this.Session.Query <JCLQ_MatchResult>() join m in this.Session.Query <JCLQ_Match>() on r.MatchId equals m.MatchId where r.CreateTime >= time && r.CreateTime < time.AddDays(1) && (r.SF_SP != 1M && r.RFSF_SP != 1M && r.SFC_SP != 1M && r.DXF_SP != 1M) orderby r.MatchId descending select new JCLQMatchResult { MatchId = UsefullHelper.GetDbValue <string>(m.MatchId), MatchIdName = UsefullHelper.GetDbValue <string>(m.MatchIdName), StartTime = UsefullHelper.GetDbValue <DateTime>(m.StartDateTime), LeagueId = UsefullHelper.GetDbValue <int>(m.LeagueId), LeagueName = UsefullHelper.GetDbValue <string>(m.LeagueName), LeagueColor = UsefullHelper.GetDbValue <string>(m.LeagueColor), HomeTeamName = UsefullHelper.GetDbValue <string>(m.HomeTeamName), GuestTeamName = UsefullHelper.GetDbValue <string>(m.GuestTeamName), MatchState = UsefullHelper.GetDbValue <string>(r.MatchState), HomeTeamScore = UsefullHelper.GetDbValue <int>(r.HomeScore), GuestTeamScore = UsefullHelper.GetDbValue <int>(r.GuestScore), SF_Result = UsefullHelper.GetDbValue <string>(r.SF_Result), SF_SP = UsefullHelper.GetDbValue <decimal>(r.SF_SP), RFSF_Result = UsefullHelper.GetDbValue <string>(r.RFSF_Result), RFSF_SP = UsefullHelper.GetDbValue <decimal>(r.RFSF_SP), DXF_Result = UsefullHelper.GetDbValue <string>(r.DXF_Result), DXF_SP = UsefullHelper.GetDbValue <decimal>(r.DXF_SP), SFC_Result = UsefullHelper.GetDbValue <string>(r.SFC_Result), SFC_SP = UsefullHelper.GetDbValue <decimal>(r.SFC_SP), RFSF_Trend = UsefullHelper.GetDbValue <string>(r.RFSF_Trend), DXF_Trend = UsefullHelper.GetDbValue <string>(r.DXF_Trend), CreateTime = UsefullHelper.GetDbValue <DateTime>(r.CreateTime), }; return(query.ToList()); }
/// <summary> /// 查询未来的奖期信息 /// </summary> public List <LotteryIssuse_QueryInfo> QueryNextIssuseList(bool byOfficial, string gameCode, int count) { Session.Clear(); var list = new List <LotteryIssuse_QueryInfo>(); var sql = string.Format(@"declare @v int select @v=convert(int, c.ConfigValue) from [C_Core_Config] c where c.configkey='Site.GameDelay.'+'{1}' select top {2} g.GameCode,g.IssuseNumber,g.LocalStopTime,g.OfficialStopTime,@v ConfigValue from [C_Game_Issuse] g where g.gameCode='{1}' and g.{0}> getdate() order by g.{0} asc", byOfficial ? "OfficialStopTime" : "LocalStopTime", gameCode, count); var array = this.Session.CreateSQLQuery(sql).List(); if (array == null) { return(list); } var schemeIdList = new List <string>(); foreach (var item in array) { var row = item as object[]; list.Add(new LotteryIssuse_QueryInfo { GameCode = UsefullHelper.GetDbValue <string>(row[0]), IssuseNumber = UsefullHelper.GetDbValue <string>(row[1]), LocalStopTime = UsefullHelper.GetDbValue <DateTime>(row[2]), OfficialStopTime = UsefullHelper.GetDbValue <DateTime>(row[3]), GameDelaySecond = UsefullHelper.GetDbValue <int>(row[4]), }); } return(list); }
public List <LotteryIssuse_QueryInfo> QueryAllGameCurrentIssuse(bool byOfficial) { Session.Clear(); var list = new List <LotteryIssuse_QueryInfo>(); var sql = string.Format(@"select g.GameCode,g.IssuseNumber,g.LocalStopTime,g.OfficialStopTime, convert(int, c.ConfigValue)ConfigValue from ( SELECT GameCode,min(IssuseNumber)IssuseNumber,min(OfficialStopTime)OfficialStopTime,min(LocalStopTime)LocalStopTime FROM [C_Game_Issuse] where gamecode in ('ssq','dlt','fc3d','pl3','cqssc','jx11x5') and {0}>getdate() group by gamecode ) as g left join [C_Core_Config] c on 'Site.GameDelay.'+g.GameCode=c.configkey", byOfficial ? "OfficialStopTime" : "LocalStopTime"); var array = this.Session.CreateSQLQuery(sql).List(); if (array == null) { return(list); } var schemeIdList = new List <string>(); foreach (var item in array) { var row = item as object[]; list.Add(new LotteryIssuse_QueryInfo { GameCode = UsefullHelper.GetDbValue <string>(row[0]), IssuseNumber = UsefullHelper.GetDbValue <string>(row[1]), LocalStopTime = UsefullHelper.GetDbValue <DateTime>(row[2]), OfficialStopTime = UsefullHelper.GetDbValue <DateTime>(row[3]), GameDelaySecond = UsefullHelper.GetDbValue <int>(row[4]), }); } return(list); }
public GameIssuse QueryCurrentNewIssuseInfo(string gameCode, string gameType) { Session.Clear(); var sql = string.Format(@"select i.* from C_Game_Issuse i inner join( select min(GameCode_IssuseNumber) as GameCode_IssuseNumber from C_Game_Issuse where GameCode='{0}' and GameType='{1}' and Status=10 and OfficialStopTime > GETDATE() ) b on i.GameCode_IssuseNumber = b.GameCode_IssuseNumber", gameCode, gameType); var list = this.Session.CreateSQLQuery(sql).List(); foreach (var item in list) { var array = item as object[]; return(new GameIssuse() { GameCode_IssuseNumber = UsefullHelper.GetDbValue <string>(array[0]), GameCode = UsefullHelper.GetDbValue <string>(array[1]), GameType = UsefullHelper.GetDbValue <string>(array[2]), IssuseNumber = UsefullHelper.GetDbValue <string>(array[3]), StartTime = UsefullHelper.GetDbValue <DateTime>(array[4]), LocalStopTime = UsefullHelper.GetDbValue <DateTime>(array[5]), GatewayStopTime = UsefullHelper.GetDbValue <DateTime>(array[6]), OfficialStopTime = UsefullHelper.GetDbValue <DateTime>(array[7]), Status = UsefullHelper.GetDbValue <IssuseStatus>(array[8]), WinNumber = UsefullHelper.GetDbValue <string>(array[9]), AwardTime = UsefullHelper.GetDbValue <DateTime>(array[10]), CreateTime = UsefullHelper.GetDbValue <DateTime>(array[11]), }); } return(null); }
public AgentCommissionDetailCollection GetAgentGetCommissionReportList(string gameCode, string gameType, string pAgentId, string userId, string displayName, int category, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize) { Session.Clear(); pageIndex = pageIndex < 0 ? 0 : pageIndex; pageSize = pageSize > BusinessHelper.MaxPageSize ? BusinessHelper.MaxPageSize : pageSize; Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_Agent_GetCommissionReportList")); query = query.AddInParameter("GameCode", gameCode); query = query.AddInParameter("GameType", gameType); query = query.AddInParameter("PAgentId", pAgentId); query = query.AddInParameter("UserId", userId); query = query.AddInParameter("DisplayName", displayName); query = query.AddInParameter("Category", category); query = query.AddInParameter("FromDate", fromDate); query = query.AddInParameter("ToDate", toDate); query = query.AddInParameter("PageIndex", pageIndex); query = query.AddInParameter("PageSize", pageSize); query = query.AddOutParameter("TotalCount", "Int32"); var ds = query.GetDataSet(out outputs); var totalCount = UsefullHelper.GetDbValue <int>(outputs["TotalCount"]); var listReport = ORMHelper.DataTableToList <AgentCommissionDetailInfo>(ds.Tables[0]); var list = ORMHelper.DataTableToList <AgentCommissionDetailInfo>(ds.Tables[1]); var saleTotal = listReport.Sum(o => o.Sale); var actualCommissionTotal = listReport.Sum(o => o.BeforeCommission); return(new AgentCommissionDetailCollection() { AgentCommissionDetailList = list, AgentCommissionReport = listReport, ActualCommissionTotal = actualCommissionTotal, SaleTotal = saleTotal, TotalCount = totalCount }); }
public TotalSingleTreasure_Collection QueryTodayBDFXList(string userId, string userName, string gameCode, string orderBy, string desc, DateTime startTime, DateTime endTime, string isMyBD, int pageIndex, int pageSize) { Session.Clear(); TotalSingleTreasure_Collection collection = new TotalSingleTreasure_Collection(); collection.TotalCount = 0; //计算上周时间 var currTime = DateTime.Now; int day = Convert.ToInt32(currTime.DayOfWeek) - 1; if (currTime.DayOfWeek != 0) { currTime = currTime.AddDays(-day); } else { currTime = currTime.AddDays(-6); } var sTime = currTime.AddDays(-7).Date; var eTime = currTime.Date; Dictionary <string, object> outputs; var query = CreateOutputQuery(Session.GetNamedQuery("P_Order_QueryTodayBDFX")) .AddInParameter("UserId", userId) .AddInParameter("UserName", userName) .AddInParameter("GameCode", gameCode) .AddInParameter("OrderBy", orderBy) .AddInParameter("Desc", desc) .AddInParameter("PageIndex", pageIndex) .AddInParameter("PageSize", pageSize) .AddInParameter("StartTime", startTime) .AddInParameter("EndTime", endTime) .AddInParameter("LastweekStartTime", sTime) .AddInParameter("LastweekEndTime", eTime) .AddInParameter("IsMyBD", isMyBD) .AddOutParameter("TotalCount", "Int32"); var dt = query.GetDataTable(out outputs); collection.TotalCount = UsefullHelper.GetDbValue <int>(outputs["TotalCount"]); if (collection.TotalCount > 0) { foreach (DataRow row in dt.Rows) { TotalSingleTreasureInfo info = new TotalSingleTreasureInfo(); info.UserId = Convert.ToString(row["UserId"]); info.UserName = Convert.ToString(row["UserName"]); info.SingleTreasureDeclaration = Convert.ToString(row["SingleTreasureDeclaration"]); info.GameCode = Convert.ToString(row["GameCode"]); info.GameType = Convert.ToString(row["GameType"]); info.IssuseNumber = Convert.ToString(row["IssuseNumber"]); info.ExpectedReturnRate = Convert.ToDecimal(row["ExpectedReturnRate"]); info.Commission = Convert.ToDecimal(row["Commission"]); info.Security = (TogetherSchemeSecurity)Convert.ToInt32(row["Security"]); info.TotalBuyCount = Convert.ToInt32(row["TotalBuyCount"]); info.TotalBuyMoney = Convert.ToDecimal(row["TotalBuyMoney"]); info.AfterTaxBonusMoney = Convert.ToDecimal(row["AfterTaxBonusMoney"]); info.FirstMatchStopTime = Convert.ToDateTime(row["FirstMatchStopTime"]); info.LastMatchStopTime = Convert.ToDateTime(row["LastMatchStopTime"]); info.ProfitRate = Convert.ToDecimal(row["ProfitRate"]); info.SchemeId = Convert.ToString(row["SchemeId"]); info.TotalBonusMoney = Convert.ToDecimal(row["TotalBonusMoney"]); info.ExpectedBonusMoney = Convert.ToDecimal(row["ExpectedBonusMoney"]); info.BetCount = Convert.ToInt32(row["BetCount"]); info.TotalMatchCount = Convert.ToInt32(row["TotalMatchCount"]); info.IsComplate = Convert.ToBoolean(row["IsComplate"]); info.CurrentBetMoney = Convert.ToDecimal(row["CurrentBetMoney"]); info.ProfitRate = Convert.ToDecimal(row["CDProfitRate"]); info.LastweekProfitRate = row["LastweekProfitRate"] == DBNull.Value ? 0 : Convert.ToDecimal(row["LastweekProfitRate"]); info.BDFXCreateTime = Convert.ToDateTime(row["BDFXCreateTime"]); info.CurrProfitRate = row["CurrProfitRate"] == DBNull.Value ? 0 : Convert.ToDecimal(row["CurrProfitRate"]); collection.TotalSingleTreasureList.Add(info); } var arrSchemeId = from o in collection.TotalSingleTreasureList select o.SchemeId; var anteCodeList = this.QueryAnteCodeList(arrSchemeId.ToArray()); collection.AnteCodeList.AddRange(anteCodeList); } return(collection); }