Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }