Example #1
0
        public JsonResult GetRevenueList(int pageIndex, int pageSize, string KeyWord, string StartDate = "", string EndDate = "", int kindID = 0)
        {
            KeyWord = FiltUtil.GetSafeSQL(KeyWord);
            string        orderby       = "ORDER BY InsertTime DESC";
            StringBuilder stringBuilder = new StringBuilder(" WHERE Revenue>0");

            if (!string.IsNullOrEmpty(KeyWord))
            {
                stringBuilder.AppendFormat(" AND Accounts='{0}'", KeyWord);
            }
            if (!string.IsNullOrEmpty(StartDate))
            {
                stringBuilder.AppendFormat(" AND InsertTime >= '{0}'", Convert.ToDateTime(StartDate));
            }
            if (!string.IsNullOrEmpty(EndDate))
            {
                stringBuilder.AppendFormat(" AND InsertTime < '{0}'", Convert.ToDateTime(EndDate));
            }
            if (kindID > 0)
            {
                stringBuilder.AppendFormat(" AND KindID={0}", kindID);
            }
            PagerSet  list    = FacadeManage.aideTreasureFacade.GetList("View_RecordDrawScore", pageIndex, pageSize, stringBuilder.ToString(), orderby);
            DataTable o       = list.PageSet.Tables[0];
            double    sum     = FacadeManage.aideTreasureFacade.SumRevenue(stringBuilder.ToString());
            DataSet   dataSet = new DataSet();

            if (HttpRuntime.Cache.Get("SumRevenueAll") == null)
            {
                dataSet = FacadeManage.aideTreasureFacade.SumRevenueAll();
                HttpRuntime.Cache.Insert("SumRevenueAll", dataSet, null, DateTime.Now.AddMinutes(1.0), TimeSpan.Zero);
            }
            else
            {
                dataSet = (HttpRuntime.Cache.Get("SumRevenueAll") as DataSet);
            }
            double sumAll   = 0.0;
            double sumAgent = 0.0;

            if (dataSet != null)
            {
                sumAll   = ((dataSet.Tables[0].Rows[0][0] is DBNull) ? 0.0 : Convert.ToDouble(dataSet.Tables[0].Rows[0][0]));
                sumAgent = ((dataSet.Tables[1].Rows[0][0] is DBNull) ? 0.0 : Convert.ToDouble(dataSet.Tables[1].Rows[0][0]));
            }
            return(Json(new
            {
                IsOk = true,
                Msg = new
                {
                    Sum = sum,
                    SumAll = sumAll,
                    SumAgent = sumAgent
                },
                Total = list.RecordCount,
                Data = JsonHelper.SerializeObject(o)
            }));
        }
Example #2
0
        public JsonResult GetLotteryBetDrawList()
        {
            int           pageIndex     = TypeUtil.ObjectToInt(base.Request["pageIndex"], 1);
            int           pageSize      = TypeUtil.ObjectToInt(base.Request["pageSize"], 10);
            string        safeSQL       = FiltUtil.GetSafeSQL(TypeUtil.ObjectToString(base.Request["GameID"]));
            string        orderby       = "ORDER BY ID DESC";
            StringBuilder stringBuilder = new StringBuilder(" WHERE 1=1");
            string        value         = base.Request["StartDate"];
            string        value2        = base.Request["EndDate"];
            string        iscomplete    = base.Request["iscomplete"];

            if (!string.IsNullOrEmpty(value))
            {
                stringBuilder.AppendFormat(" AND inserttime >= '{0}'", Convert.ToDateTime(value));
            }
            if (!string.IsNullOrEmpty(value2))
            {
                stringBuilder.AppendFormat(" AND inserttime < '{0}'", Convert.ToDateTime(value2));
            }
            if (!string.IsNullOrEmpty(safeSQL))
            {
                stringBuilder.AppendFormat(" AND userid in (select userid from RYAccountsDB.dbo.accountsinfo where gameid like '%{0}%')", safeSQL);
            }
            iscomplete = iscomplete ?? "-1";
            stringBuilder.AppendFormat(" AND (iscomplete ={0} or -1={0})", iscomplete);
            PagerSet  list        = FacadeManage.aideTreasureFacade.GetList(@"(select a.*,b.gameid,isnull(bet.betscore,0) betscore1  from LotteryBetDraw a left join RYAccountsDB.dbo.accountsinfo b on a.userid = b.userid left join  (select sum(b.betscore) betscore,b.userid from (select userid,max(ApplyDate) ApplyDate from RYTreasureDB.dbo.OnLineOrder where OrderStatus=2 group by userid) a inner join 
(select  userid,betscore,inserttime from RYTreasureDB.dbo.LotteryBetDraw) b on a.userid = b.userid and b.inserttime >=a.ApplyDate
group by b.userid) bet on a.userid = bet.userid )  as tab ", pageIndex, pageSize, stringBuilder.ToString(), orderby);
            DataTable o           = list.PageSet.Tables[0];
            decimal   SumWinScore = Convert.ToDecimal(FacadeManage.aideTreasureFacade.SumWinScore(stringBuilder.ToString()));
            decimal   Sumbetscore = Convert.ToDecimal(FacadeManage.aideTreasureFacade.Sumbetscore(stringBuilder.ToString()));

            return(Json(new
            {
                IsOk = true,
                Msg = new
                {
                    SumWinScore = SumWinScore,
                    Sumbetscore = Sumbetscore
                },
                Total = list.RecordCount,
                Data = JsonHelper.SerializeObject(o)
            }));
        }
Example #3
0
        public JsonResult GetTixianList()
        {
            int           pageIndex     = TypeUtil.ObjectToInt(base.Request["pageIndex"], 1);
            int           pageSize      = TypeUtil.ObjectToInt(base.Request["pageSize"], 10);
            string        safeSQL       = FiltUtil.GetSafeSQL(TypeUtil.ObjectToString(base.Request["OrderID"]));
            string        orderby       = "ORDER BY ID DESC";
            StringBuilder stringBuilder = new StringBuilder(" WHERE 1=1");
            string        value         = base.Request["StartDate"];
            string        value2        = base.Request["EndDate"];

            if (!string.IsNullOrEmpty(value))
            {
                stringBuilder.AppendFormat(" AND CollectDate >= '{0}'", Convert.ToDateTime(value));
            }
            if (!string.IsNullOrEmpty(value2))
            {
                stringBuilder.AppendFormat(" AND CollectDate < '{0}'", Convert.ToDateTime(value2));
            }
            if (!string.IsNullOrEmpty(safeSQL))
            {
                stringBuilder.AppendFormat(" AND OrderID='{0}'", safeSQL);
            }
            PagerSet  list = FacadeManage.aideNativeWebFacade.GetList("T_PlatformDraw", pageIndex, pageSize, stringBuilder.ToString(), orderby);
            DataTable o    = list.PageSet.Tables[0];
            decimal   sum  = Convert.ToDecimal(FacadeManage.aideNativeWebFacade.SumPlayerDraw(stringBuilder.ToString()));

            return(Json(new
            {
                IsOk = true,
                Msg = new
                {
                    Sum = sum
                },
                Total = list.RecordCount,
                Data = JsonHelper.SerializeObject(o)
            }));
        }
Example #4
0
        public JsonResult GetTradeList()
        {
            int           pageIndex     = TypeUtil.ObjectToInt(base.Request["pageIndex"], 1);
            int           pageSize      = TypeUtil.ObjectToInt(base.Request["pageSize"], 10);
            int           num           = TypeUtil.ObjectToInt(base.Request["Type"]);
            int           num2          = TypeUtil.ObjectToInt(base.Request["SearchType"]);
            int           num3          = TypeUtil.ObjectToInt(base.Request["TradeType"]);
            string        safeSQL       = FiltUtil.GetSafeSQL(TypeUtil.ObjectToString(base.Request["KeyWord"]));
            string        orderby       = "ORDER BY ID DESC";
            StringBuilder stringBuilder = new StringBuilder(" WHERE 1=1");

            if (!string.IsNullOrEmpty(safeSQL))
            {
                switch (num2)
                {
                case 1:
                    stringBuilder.AppendFormat(" AND Accounts='{0}'", safeSQL);
                    break;

                case 2:
                    stringBuilder.AppendFormat(" AND RealName='{0}'", safeSQL);
                    break;

                case 3:
                    stringBuilder.AppendFormat(" AND OrderID='{0}'", safeSQL);
                    break;

                case 4:
                    stringBuilder.AppendFormat(" AND SellScore={0}", Convert.ToInt32(safeSQL));
                    break;
                }
            }
            string   text  = base.Request["StartDate"];
            string   text2 = base.Request["EndDate"];
            DateTime now   = DateTime.Now;

            switch (num)
            {
            case 2:
                text  = Fetch.GetTodayTime().Split('$')[0].ToString();
                text2 = Fetch.GetTodayTime().Split('$')[1].ToString();
                stringBuilder.AppendFormat(" AND ApplyDate BETWEEN '{0}' AND '{1}'", text, text2);
                break;

            case 3:
                text  = Fetch.GetYesterdayTime().Split('$')[0].ToString();
                text2 = Fetch.GetYesterdayTime().Split('$')[1].ToString();
                stringBuilder.AppendFormat(" AND ApplyDate BETWEEN '{0}' AND '{1}'", text, text2);
                break;

            case 4:
                text  = Fetch.GetWeekTime().Split('$')[0].ToString();
                text2 = Fetch.GetWeekTime().Split('$')[1].ToString();
                stringBuilder.AppendFormat(" AND ApplyDate BETWEEN '{0}' AND '{1}'", text, text2);
                break;

            case 5:
                text  = Fetch.GetLastWeekTime().Split('$')[0].ToString();
                text2 = Fetch.GetLastWeekTime().Split('$')[1].ToString();
                stringBuilder.AppendFormat(" AND ApplyDate BETWEEN '{0}' AND '{1}'", text, text2);
                break;

            case 6:
                text  = now.ToString("yyyy-MM-01");
                text2 = now.ToString("yyyy-MM-dd 23:59:59");
                stringBuilder.AppendFormat(" AND ApplyDate BETWEEN '{0}' AND '{1}'", text, text2);
                break;

            case 7:
                text  = now.AddMonths(-1).ToString("yyyy-MM-01");
                text2 = now.ToString("yyyy-MM-01");
                stringBuilder.AppendFormat(" AND ApplyDate BETWEEN '{0}' AND '{1}'", text, text2);
                break;

            default:
                if (text != "")
                {
                    stringBuilder.AppendFormat(" AND ApplyDate > '{0}'", Convert.ToDateTime(text));
                }
                if (text2 != "")
                {
                    stringBuilder.AppendFormat(" AND ApplyDate <= '{0}'", Convert.ToDateTime(text2));
                }
                break;
            }
            if (num3 > 0)
            {
                stringBuilder.AppendFormat(" AND Status={0}", num3);
            }
            PagerSet  list         = FacadeManage.aideAccountsFacade.GetList("View_ApplyOrder", pageIndex, pageSize, stringBuilder.ToString(), orderby);
            DataTable o            = list.PageSet.Tables[0];
            decimal   sum          = FacadeManage.aideAccountsFacade.SumPlayerDraw(stringBuilder.ToString());
            int       successCount = FacadeManage.aideAccountsFacade.SuccessCount(stringBuilder.ToString());

            return(Json(new
            {
                IsOk = true,
                Msg = new
                {
                    Sum = sum,
                    SuccessCount = successCount
                },
                Total = list.RecordCount,
                Data = JsonHelper.SerializeObject(o)
            }));
        }
 public void OnActionExecuting(ActionExecutingContext filterContext)
 {
     ParameterDescriptor[] parameters = filterContext.ActionDescriptor.GetParameters();
     ParameterDescriptor[] array      = parameters;
     foreach (ParameterDescriptor parameterDescriptor in array)
     {
         if (parameterDescriptor.ParameterType == typeof(string) && filterContext.ActionParameters[parameterDescriptor.ParameterName] != null)
         {
             filterContext.ActionParameters[parameterDescriptor.ParameterName] = FiltUtil.GetSafeSQL(filterContext.ActionParameters[parameterDescriptor.ParameterName].ToString());
         }
     }
 }
Example #6
0
        public JsonResult GetAccountScoreList()
        {
            int    num     = TypeUtil.ObjectToInt(base.Request["pageIndex"], 1);
            int    num2    = TypeUtil.ObjectToInt(base.Request["pageSize"], 10);
            int    num3    = TypeUtil.ObjectToInt(base.Request["DateType"]);
            string s       = TypeUtil.ObjectToString(base.Request["StartDate"]);
            string s2      = TypeUtil.ObjectToString(base.Request["EndDate"]);
            int    num4    = TypeUtil.ObjectToInt(base.Request["sort"]);
            string safeSQL = FiltUtil.GetSafeSQL(TypeUtil.ObjectToString(base.Request["KeyWord"]));
            Dictionary <string, string> dictionary = new Dictionary <string, string>();
            DateTime result  = DateTime.Now;
            DateTime result2 = DateTime.Now;
            string   text    = "";
            string   text2   = "";

            switch (num3)
            {
            case 0:
                if (!string.IsNullOrEmpty(safeSQL))
                {
                    dictionary.Add("Acc", safeSQL);
                }
                else
                {
                    dictionary.Add("Acc", "");
                }
                if (DateTime.TryParse(s, out result) && DateTime.TryParse(s2, out result2))
                {
                    if (result > result2)
                    {
                        text  = DateTime.Now.ToString("yyyy-MM-dd");
                        text2 = DateTime.Now.ToString("yyyy-MM-dd");
                        dictionary.Add("BTime", text);
                        dictionary.Add("ETime", text2);
                    }
                    else
                    {
                        text  = result.ToString("yyyy-MM-dd");
                        text2 = result2.ToString("yyyy-MM-dd");
                        dictionary.Add("BTime", text);
                        dictionary.Add("ETime", text2);
                    }
                }
                else
                {
                    text  = DateTime.Now.ToString("yyyy-MM-dd");
                    text2 = DateTime.Now.ToString("yyyy-MM-dd");
                    dictionary.Add("BTime", text);
                    dictionary.Add("ETime", text2);
                }
                break;

            case 1:
                dictionary.Add("Acc", "");
                text  = DateTime.Now.ToString("yyyy-MM-dd");
                text2 = DateTime.Now.ToString("yyyy-MM-dd");
                dictionary.Add("BTime", text);
                dictionary.Add("ETime", text2);
                break;

            case 2:
                dictionary.Add("Acc", "");
                text  = DateTime.Now.AddDays(-1.0).ToString("yyyy-MM-dd");
                text2 = DateTime.Now.AddDays(-1.0).ToString("yyyy-MM-dd");
                dictionary.Add("BTime", text);
                dictionary.Add("ETime", text2);
                break;

            case 3:
                dictionary.Add("Acc", "");
                text  = DateTime.Now.AddDays((double)(-Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d")))).ToString("yyyy-MM-dd");
                text2 = DateTime.Now.AddDays((double)(-Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d")))).AddDays(6.0).ToString("yyyy-MM-dd");
                dictionary.Add("BTime", text);
                dictionary.Add("ETime", text2);
                break;

            case 4:
                dictionary.Add("Acc", "");
                text  = DateTime.Now.AddDays((double)(-7 - Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d")))).ToString("yyyy-MM-dd");
                text2 = DateTime.Now.AddDays((double)(-7 - Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d")))).AddDays(6.0).ToString("yyyy-MM-dd");
                dictionary.Add("BTime", text);
                dictionary.Add("ETime", text2);
                break;
            }
            dictionary.Add("DescOrAsc", num4.ToString());
            dictionary.Add("PageSize", num2.ToString());
            dictionary.Add("PageIndex", num.ToString());
            dictionary.Add("PageCount|RecordCount", "");
            PagerSet      pager = FacadeManage.aideTreasureFacade.GetPager(dictionary, "P_QueryUserRDScore");
            List <object> list  = new List <object>();

            if (pager.PageSet.Tables[0] != null && pager.PageSet.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in pager.PageSet.Tables[0].Rows)
                {
                    list.Add(new
                    {
                        UserID    = TypeUtil.ObjectToInt(row["UserID"]),
                        Accounts  = TypeUtil.ObjectToString(row["Accounts"]),
                        NickName  = TypeUtil.ObjectToString(row["NickName"]),
                        Score     = row["Score"],
                        StartTime = text,
                        EndTime   = text2
                    });
                }
            }
            return(Json(new
            {
                IsOk = true,
                Msg = "",
                Total = pager.RecordCount,
                Data = list
            }));
        }