private void BindData() { DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(base._Site.ID.ToString() + "MemberChase" + base._User.ID.ToString()); string condition = string.Concat(new object[] { "[UserID] = ", base._User.ID.ToString(), " and SiteID = ", base._Site.ID }); if (this.isDateValid()) { string str2 = condition; condition = str2 + " and Convert(datetime,[DateTime]) between '" + this.txtStartDate.Text + " 0:0:0' and '" + this.txtEndDate.Text + " 23:59:59'"; } if (cacheAsDataTable == null) { cacheAsDataTable = new Views.V_ChaseTasksTotal().Open("", condition, "[DateTime] desc"); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试", "Room_ViewChase"); return; } Shove._Web.Cache.SetCache(base._Site.ID.ToString() + "MemberChase" + base._User.ID.ToString(), cacheAsDataTable); } PF.DataGridBindData(this.g1, cacheAsDataTable, this.gPager1); this.gPager1.Visible = true; this.lblPageBuyMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 12, true, this.gPager1.PageSize, this.gPager1.PageIndex).ToString("N"); this.lblTotalBuyMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 12, false, this.gPager1.PageSize, this.gPager1.PageIndex).ToString("N"); }
private void BindData() { DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(base._Site.ID.ToString() + "AccountFreezeDetail_" + base._User.ID.ToString()); if (cacheAsDataTable == null) { int returnValue = 0; string returnDescription = ""; DataSet ds = null; Procedures.P_GetUserFreezeDetail(ref ds, base._Site.ID, base._User.ID, ref returnValue, ref returnDescription); if ((ds == null) || (ds.Tables.Count < 1)) { PF.GoError(4, "数据库繁忙,请重试", "Room_AccountFreezeDetail"); return; } cacheAsDataTable = ds.Tables[0]; Shove._Web.Cache.SetCache(base._Site.ID.ToString() + "AccountFreezeDetail_" + base._User.ID.ToString(), cacheAsDataTable); } PF.DataGridBindData(this.g, cacheAsDataTable); if (((this.gPager.PageIndex + 1) * this.gPager.PageSize) > cacheAsDataTable.Rows.Count) { this.lblPageFreezeCount.Text = (cacheAsDataTable.Rows.Count % this.gPager.PageSize).ToString(); } else { this.lblPageFreezeCount.Text = this.gPager.PageSize.ToString(); } this.lblPageFreezeSum.Text = PF.GetSumByColumn(cacheAsDataTable, 1, true, this.gPager.PageSize, this.gPager.PageIndex).ToString("N"); this.lblTotalFreezeCount.Text = cacheAsDataTable.Rows.Count.ToString(); this.lblTotalFreezeSum.Text = PF.GetSumByColumn(cacheAsDataTable, 1, false, this.gPager.PageSize, this.gPager.PageIndex).ToString("N"); }
private void BindDistills() { if (_User == null) { return; } string CacheKeyName = "Home_Room_DistillDetail_" + _User.ID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(CacheKeyName); if (dt == null) { dt = new DAL.Views.V_UserDistills().Open("ID,[DateTime],[Money],FormalitiesFees,Result,Memo", "[UserID] = " + _User.ID.ToString() + "", "[DateTime] desc, [ID]"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试(732)", this.GetType().FullName); return; } Shove._Web.Cache.SetCache(CacheKeyName, dt, 60); } gUserDistills.DataSource = dt; gUserDistills.DataBind(); this.lblDistillCount.Text = dt.Rows.Count.ToString(); this.lblDistillMoney.Text = PF.GetSumByColumn(dt, 2, false, gUserDistills.PageSize, 0).ToString("N"); }
private void BindUserPayData() { if (_User == null) { return; } string CacheKeyName = "Home_Room_OnlinePay_CardPassword_Default_BindUserPayData" + _User.ID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(CacheKeyName); if (dt == null) { dt = Shove.Database.MSSQL.Select("select a.ID,AgentID,a.DateTime,a.Money,PayNumber from (select ID,[DateTime],[Money],PayNumber from T_UserDetails where OperatorType = 502 and UserID = " + _User.ID.ToString() + ")a inner join T_CardPasswords b on a.PayNumber = b.ID order by a.ID desc"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试(732)", this.GetType().FullName); return; } Shove._Web.Cache.SetCache(CacheKeyName, dt, 60); } gUserPay.DataSource = dt; gUserPay.DataBind(); this.lblUserPayMoneys.Text = PF.GetSumByColumn(dt, 2, false, gUserPay.PageSize, 0).ToString("N"); }
private void BindDataReward() { if (_User == null) { return; } string CacheKeyName = "Invest_Reward_" + _User.ID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(CacheKeyName); if (dt == null) { dt = new DAL.Views.V_BuyDetailsWithQuashedAll().Open("UserID, SchemeID, LotteryNumber, IsuseName, SchemeWinMoney, LotteryName, WinMoneyNoWithTax,DetailMoney" , "[UserID] = " + _User.ID.ToString() + " and (EndTime < GetDate() or LotteryID in (72,73)) and WinMoneyNoWithTax > 0" , "[DateTime] desc, [ID]"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试(732)", this.GetType().FullName); return; } Shove._Web.Cache.SetCache(CacheKeyName, dt, 3600); } gReward.DataSource = dt; gReward.DataBind(); this.lblRewardCount.Text = dt.Rows.Count.ToString(); this.lblRewardMoney.Text = PF.GetSumByColumn(dt, 6, false, gReward.PageSize, 0).ToString("N"); }
protected void g_ItemDataBound(object sender, DataGridItemEventArgs e) { if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem)) { double num = _Convert.StrToDouble((e.Item.Cells[2].FindControl("lblIn") as Label).Text, 0.0); e.Item.Cells[2].Text = (num == 0.0) ? "" : num.ToString("N"); num = _Convert.StrToDouble((e.Item.Cells[3].FindControl("Label2") as Label).Text, 0.0); e.Item.Cells[3].Text = (num == 0.0) ? "" : num.ToString("N"); num = _Convert.StrToDouble((e.Item.Cells[4].FindControl("Label3") as Label).Text, 0.0); e.Item.Cells[4].Text = (num == 0.0) ? "" : num.ToString("N"); num = _Convert.StrToDouble((e.Item.Cells[5].FindControl("Label4") as Label).Text, 0.0); e.Item.Cells[5].Text = (num == 0.0) ? "" : num.ToString("N"); num = _Convert.StrToDouble((e.Item.Cells[6].FindControl("Label5") as Label).Text, 0.0); e.Item.Cells[6].Text = (num == 0.0) ? "" : num.ToString("N"); num = _Convert.StrToDouble((e.Item.Cells[7].FindControl("Label6") as Label).Text, 0.0); e.Item.Cells[7].Text = (num == 0.0) ? "" : num.ToString("N"); long num2 = _Convert.StrToLong((e.Item.Cells[8].FindControl("Label7") as Label).Text, -1L); if (num2 >= 0L) { (e.Item.Cells[1].FindControl("lblMemo") as Label).Text = "<a href='../Home/Room/Scheme.aspx?id=" + num2.ToString() + "' target='_blank'><font color=\"#330099\">" + (e.Item.Cells[1].FindControl("lblMemo") as Label).Text + "</Font></a>"; } } else if (e.Item.ItemType == ListItemType.Footer) { e.Item.Cells[0].ColumnSpan = 2; e.Item.Cells.RemoveAt(8); e.Item.Cells[0].Text = "合计"; e.Item.Cells[1].Text = PF.GetSumByColumn(this.ds.Tables[0], 3, false, 30, this.gPager.PageIndex).ToString("N"); e.Item.Cells[2].Text = PF.GetSumByColumn(this.ds.Tables[0], 4, false, 30, this.gPager.PageIndex).ToString("N"); e.Item.Cells[3].Text = PF.GetSumByColumn(this.ds.Tables[0], 5, false, 30, this.gPager.PageIndex).ToString("N"); e.Item.Cells[5].Text = PF.GetSumByColumn(this.ds.Tables[0], 7, false, 30, this.gPager.PageIndex).ToString("N"); e.Item.Cells[7].Visible = false; } }
private void BindData() { DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(_Site.ID.ToString() + "MemberChase" + _User.ID.ToString()); string Condition = "[UserID] = " + _User.ID.ToString() + " and SiteID = " + _Site.ID; if (isDateValid()) { Condition += " and Convert(datetime,[DateTime]) between '" + txtStartDate.Text + " 0:0:0' and '" + txtEndDate.Text + " 23:59:59'"; } if (dt == null) { dt = new DAL.Views.V_ChaseTasksTotal().Open("", Condition, "[DateTime] desc"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Room_ViewChase"); return; } Shove._Web.Cache.SetCache(_Site.ID.ToString() + "MemberChase" + _User.ID.ToString(), dt); } PF.DataGridBindData(g1, dt, gPager1); gPager1.Visible = true; this.lblPageBuyMoney.Text = PF.GetSumByColumn(dt, 12, true, gPager1.PageSize, gPager1.PageIndex).ToString("N"); this.lblTotalBuyMoney.Text = PF.GetSumByColumn(dt, 12, false, gPager1.PageSize, gPager1.PageIndex).ToString("N"); }
private void BindHistoryData() { if (ddlIsuse.Items.Count < 0) { Shove._Web.JavaScript.Alert(this.Page, "请选择彩种、玩法和期号。"); return; } string Condition = " [UserID] = " + _User.ID.ToString(); if (ddlLottery.SelectedValue != "-1") { Condition += " and LotteryID=" + Shove._Convert.StrToInt(ddlLottery.SelectedValue, -1).ToString(); } if (ddlIsuse.SelectedValue == "-1") { Condition += " and EndTime < GetDate()"; } else { Condition += " and IsuseID=" + Shove._Convert.StrToLong(ddlIsuse.SelectedValue, -1).ToString(); } if (ddlPlayType.SelectedValue != "-1") { Condition += " and PlayTypeID = " + Shove._Convert.StrToInt(ddlPlayType.SelectedValue, -1).ToString(); } string CacheKey = "InvestHistory_" + Condition; DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(CacheKey); if (dt == null) { dt = new DAL.Views.V_BuyDetailsWithQuashedAll().Open("*", Condition, "[DateTime] desc, [ID]"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } Shove._Web.Cache.SetCache(CacheKey, dt, 60); } PF.DataGridBindData(gHistory, dt, gPagerHistory); gPagerHistory.Visible = true; this.lblPageBuySum.Text = PF.GetSumByColumn(dt, 10, true, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblPageRewardSum.Text = PF.GetSumByColumn(dt, 8, true, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblTotalBuySum.Text = PF.GetSumByColumn(dt, 10, false, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblTotalRewardSum.Text = PF.GetSumByColumn(dt, 8, false, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); }
private void BindDataInvestHistory() { if (base._User != null) { string key = "Room_Welcome_InvestHistory_" + base._User.ID.ToString(); DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); string condition = "[UserID] = " + base._User.ID.ToString() + " and EndTime < GetDate()"; if (this.ddlLottery.SelectedIndex > 0) { condition = condition + " and LotteryID=" + _Convert.StrToInt(this.ddlLottery.SelectedValue, -1).ToString(); } if (cacheAsDataTable == null) { cacheAsDataTable = new Views.V_BuyDetailsWithQuashedAll().Open("UserID, SchemeID, LotteryNumber, IsuseName, SchemeWinMoney, LotteryName, WinMoneyNoWithTax, IsOpened,DetailMoney", condition, "[DateTime] desc, [ID]"); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试(641)", base.GetType().FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 300); } this.gInvestHistory.DataSource = cacheAsDataTable; this.gInvestHistory.DataBind(); this.lblBuySum.Text = PF.GetSumByColumn(cacheAsDataTable, 8, false, this.gInvestHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblSumWinMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 4, false, this.gInvestHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblMySumWinMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 6, false, this.gInvestHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); double num7 = _Convert.StrToDouble(this.lblSumWinMoney.Text, 0.0); double num8 = _Convert.StrToDouble(this.lblSumWinMoney.Text, 0.0); double num9 = num7 - num8; if (num9 <= 0.0) { this.lblSumWinProfitPoints.Text = "0.00"; } else { double num10 = num9 / num8; if (num10 > 1.0) { this.lblSumWinProfitPoints.Text = Math.Round(num10, 2).ToString("N") + "倍"; } else { this.lblSumWinProfitPoints.Text = ((Math.Round(num10, 2) * 100.0)).ToString("N") + "%"; } } this.lbgInvestHistoryMessage.Text = "显示 10 条,共 " + cacheAsDataTable.Rows.Count.ToString() + " 条记录 ,<span class=\"blue\"><a href='InvestHistory.aspx'>[查看全部记录]</a></span>"; } }
private void BindDataInvestHistory() { if (base._User != null) { string key = "Home_Room_Invest_BindHistoryData" + base._User.ID.ToString(); DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { StringBuilder builder = new StringBuilder(); builder.Append("select * from (select LotteryID,LotteryName,PlayTypeID,InitiateName,PlayTypeName, ").Append("SchemeShare,a.Money,b.Share,b.DetailMoney,SchemeWinMoney, b.WinMoneyNoWithTax,a.DateTime, ").Append("b.SchemeID,QuashStatus,Buyed,AssureMoney,BuyedShare,IsOpened,c.Memo from ").Append("(select UserID,SchemeID,SUM(Share) as Share,SUM(DetailMoney) as DetailMoney, ").Append("sum(WinMoneyNoWithTax) as WinMoneyNoWithTax from V_BuyDetailsWithQuashedAll ").Append("where UserID = " + base._User.ID.ToString() + " and InitiateUserID = UserID group by SchemeID,UserID)b ").Append("left join (select * from V_BuyDetailsWithQuashedAll where UserID = " + base._User.ID.ToString() + " and ").Append("UserID = InitiateUserID and isWhenInitiate = 1)a ").Append("on a.UserID = b.UserID and ").Append("a.SchemeID = b.SchemeID left join (select SchemeID,Memo from T_UserDetails where ").Append("OperatorType = 9 and UserID = " + base._User.ID.ToString() + ") c ").Append("on b.SchemeID = c.SchemeID union select LotteryID,LotteryName,PlayTypeID,InitiateName, ").Append("PlayTypeName,SchemeShare,a.Money,Share,DetailMoney,SchemeWinMoney, WinMoneyNoWithTax, ").Append("a.DateTime,a.SchemeID,QuashStatus,Buyed,AssureMoney,BuyedShare,IsOpened,b.Memo from ").Append("(select * from V_BuyDetailsWithQuashedAll where UserID = " + base._User.ID.ToString() + " and UserID<>InitiateUserID) a left join (select SchemeID,Memo from T_UserDetails where ").Append("OperatorType = 9 and UserID = " + base._User.ID.ToString() + ")b on a.SchemeID = b.SchemeID)a order by DateTime desc"); cacheAsDataTable = MSSQL.Select(builder.ToString(), new MSSQL.Parameter[0]); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60); } this.gInvestHistory.DataSource = cacheAsDataTable; this.gInvestHistory.DataBind(); this.lblBuySum.Text = PF.GetSumByColumn(cacheAsDataTable, 8, false, this.gInvestHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblSumWinMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 9, false, this.gInvestHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblMySumWinMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 10, false, this.gInvestHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); double num10 = _Convert.StrToDouble(this.lblSumWinMoney.Text, 0.0); double num11 = _Convert.StrToDouble(this.lblBuySum.Text, 0.0); double num12 = num10 - num11; if (num12 <= 0.0) { this.lblSumWinProfitPoints.Text = "0.00"; } else { double num13 = num12 / num11; if (num13 > 1.0) { this.lblSumWinProfitPoints.Text = Math.Round(num13, 2).ToString("N") + "倍"; } else { this.lblSumWinProfitPoints.Text = ((Math.Round(num13, 2) * 100.0)).ToString("N") + "%"; } } this.lbgInvestHistoryMessage.Text = "显示 10 条,共 " + cacheAsDataTable.Rows.Count.ToString() + " 条记录 ,<span class=\"blue12_line\"><a href='InvestHistory.aspx'>[查看全部记录]</a></span>"; } }
private void BindHistoryData() { if (this.ddlIsuse.Items.Count < 0) { JavaScript.Alert(this.Page, "请选择彩种、玩法和期号。"); } else { string condition = " [UserID] = " + base._User.ID.ToString(); if (this.ddlLottery.SelectedValue != "-1") { condition = condition + " and LotteryID=" + _Convert.StrToInt(this.ddlLottery.SelectedValue, -1).ToString(); } if (this.ddlIsuse.SelectedValue == "-1") { condition = condition + " and EndTime < GetDate()"; } else { condition = condition + " and IsuseID=" + _Convert.StrToLong(this.ddlIsuse.SelectedValue, -1L).ToString(); } if (this.ddlPlayType.SelectedValue != "-1") { condition = condition + " and PlayTypeID = " + _Convert.StrToInt(this.ddlPlayType.SelectedValue, -1).ToString(); } string key = "InvestHistory_" + condition; DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { cacheAsDataTable = new Views.V_BuyDetailsWithQuashedAll().Open("*", condition, "[DateTime] desc, [ID]"); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60); } PF.DataGridBindData(this.gHistory, cacheAsDataTable, this.gPagerHistory); this.gPagerHistory.Visible = true; this.lblPageBuySum.Text = PF.GetSumByColumn(cacheAsDataTable, 10, true, this.gPagerHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblPageRewardSum.Text = PF.GetSumByColumn(cacheAsDataTable, 8, true, this.gPagerHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblTotalBuySum.Text = PF.GetSumByColumn(cacheAsDataTable, 10, false, this.gPagerHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblTotalRewardSum.Text = PF.GetSumByColumn(cacheAsDataTable, 8, false, this.gPagerHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); } }
/// <summary> /// 绑定定制的跟单记录 /// </summary> private void BindData() { string Condition = " a.[UserID] = " + _User.ID.ToString() + " and StartTime < GetDate() "; if (ddlLottery.SelectedValue != "-1") { Condition += " and LotteryID=" + Shove._Convert.StrToInt(ddlLottery.SelectedValue, -1).ToString() + ""; } if (ddlPlayType.SelectedValue != "-1") { Condition += " and PlayTypeID = " + Shove._Convert.StrToInt(ddlPlayType.SelectedValue, -1).ToString(); } if (Condition != "") { Condition += " and isAutoFollowScheme = 1"; } else { Condition = "isAutoFollowScheme = 1"; } DataTable dt = Shove.Database.MSSQL.Select("select a.*,b.Memo from V_BuyDetailsWithQuashedAll a left join (select Memo,SchemeID from T_UserDetails where OperatorType = 9)b on a.SchemeID = b.SchemeID where " + Condition + " order by a.ID desc"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Room_InvestHistory"); return; } PF.DataGridBindData(g, dt, gPager); gPager.Visible = true; //本页记录 this.lblPageBuyMoney.Text = PF.GetSumByColumn(dt, 10, true, gPager.PageSize, gPager.PageIndex).ToString("N"); this.lblPageReward.Text = PF.GetSumByColumn(dt, 8, true, gPager.PageSize, gPager.PageIndex).ToString("N"); //总记录 this.lblTotalBuyMoney.Text = PF.GetSumByColumn(dt, 10, false, gPager.PageSize, gPager.PageIndex).ToString("N"); this.lblTotalReward.Text = PF.GetSumByColumn(dt, 8, false, gPager.PageSize, gPager.PageIndex).ToString("N"); }
protected void g_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem) { double money; money = Shove._Convert.StrToDouble((e.Item.Cells[2].FindControl("lblIn") as Label).Text, 0); e.Item.Cells[2].Text = (money == 0) ? "" : money.ToString("N"); money = Shove._Convert.StrToDouble((e.Item.Cells[3].FindControl("Label2") as Label).Text, 0); e.Item.Cells[3].Text = (money == 0) ? "" : money.ToString("N"); money = Shove._Convert.StrToDouble((e.Item.Cells[4].FindControl("Label3") as Label).Text, 0); e.Item.Cells[4].Text = (money == 0) ? "" : money.ToString("N"); money = Shove._Convert.StrToDouble((e.Item.Cells[5].FindControl("Label4") as Label).Text, 0); e.Item.Cells[5].Text = (money == 0) ? "" : money.ToString("N"); money = Shove._Convert.StrToDouble((e.Item.Cells[6].FindControl("Label5") as Label).Text, 0); e.Item.Cells[6].Text = (money == 0) ? "" : money.ToString("N"); money = Shove._Convert.StrToDouble((e.Item.Cells[7].FindControl("Label6") as Label).Text, 0); e.Item.Cells[7].Text = (money == 0) ? "" : money.ToString("N"); long SchemeID = Shove._Convert.StrToLong((e.Item.Cells[8].FindControl("Label7") as Label).Text, -1); if (SchemeID >= 0) { (e.Item.Cells[1].FindControl("lblMemo") as Label).Text = "<a href='../Home/Room/Scheme.aspx?id=" + SchemeID.ToString() + "' target='_blank'><font color=\"#330099\">" + (e.Item.Cells[1].FindControl("lblMemo") as Label).Text + "</Font></a>"; } } else if (e.Item.ItemType == ListItemType.Footer) { e.Item.Cells[0].ColumnSpan = 2; e.Item.Cells.RemoveAt(8); e.Item.Cells[0].Text = "合计"; e.Item.Cells[1].Text = PF.GetSumByColumn(ds.Tables[0], 3, false, 30, gPager.PageIndex).ToString("N"); e.Item.Cells[2].Text = PF.GetSumByColumn(ds.Tables[0], 4, false, 30, gPager.PageIndex).ToString("N"); e.Item.Cells[3].Text = PF.GetSumByColumn(ds.Tables[0], 5, false, 30, gPager.PageIndex).ToString("N"); e.Item.Cells[5].Text = PF.GetSumByColumn(ds.Tables[0], 7, false, 30, gPager.PageIndex).ToString("N"); e.Item.Cells[7].Visible = false; //e.Item.Cells[6].Text = PF.GetSumByColumn(ds.Tables[0], 7, false, 30, gPager.PageIndex).ToString(); } }
private void BindData() { DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(_Site.ID.ToString() + "AccountFreezeDetail_" + _User.ID.ToString()); if (dt == null) { int ReturnValue = 0; string ReturnDescription = ""; DataSet ds = null; DAL.Procedures.P_GetUserFreezeDetail(ref ds, _Site.ID, _User.ID, ref ReturnValue, ref ReturnDescription); if ((ds == null) || (ds.Tables.Count < 1)) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Room_AccountFreezeDetail"); return; } dt = ds.Tables[0]; Shove._Web.Cache.SetCache(_Site.ID.ToString() + "AccountFreezeDetail_" + _User.ID.ToString(), dt); } PF.DataGridBindData(g, dt); //页面总计 if (((gPager.PageIndex + 1) * gPager.PageSize) > dt.Rows.Count) { this.lblPageFreezeCount.Text = (dt.Rows.Count % gPager.PageSize).ToString(); } else { this.lblPageFreezeCount.Text = gPager.PageSize.ToString(); } this.lblPageFreezeSum.Text = PF.GetSumByColumn(dt, 1, true, gPager.PageSize, gPager.PageIndex).ToString("N"); //总计 this.lblTotalFreezeCount.Text = dt.Rows.Count.ToString(); this.lblTotalFreezeSum.Text = PF.GetSumByColumn(dt, 1, false, gPager.PageSize, gPager.PageIndex).ToString("N"); }
private void BindHistoryData() { string key = "Home_Room_Invest_BindHistoryData" + base._User.ID.ToString(); DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { StringBuilder builder = new StringBuilder(); builder.Append("select * from (select LotteryID,LotteryName,PlayTypeID,InitiateName,PlayTypeName, ").Append("SchemeShare,a.Money,b.Share,b.DetailMoney,SchemeWinMoney, b.WinMoneyNoWithTax,a.DateTime, ").Append("b.SchemeID,QuashStatus,Buyed,AssureMoney,BuyedShare,IsOpened,c.Memo from ").Append("(select UserID,SchemeID,SUM(Share) as Share,SUM(DetailMoney) as DetailMoney, ").Append("sum(WinMoneyNoWithTax) as WinMoneyNoWithTax from V_BuyDetailsWithQuashedAll ").Append("where UserID = " + base._User.ID.ToString() + " and InitiateUserID = UserID group by SchemeID,UserID)b ").Append("left join (select * from V_BuyDetailsWithQuashedAll where UserID = " + base._User.ID.ToString() + " and ").Append("UserID = InitiateUserID and isWhenInitiate = 1)a ").Append("on a.UserID = b.UserID and ").Append("a.SchemeID = b.SchemeID left join (select SchemeID,Memo from T_UserDetails where ").Append("OperatorType = 9 and UserID = " + base._User.ID.ToString() + ") c ").Append("on b.SchemeID = c.SchemeID union select LotteryID,LotteryName,PlayTypeID,InitiateName, ").Append("PlayTypeName,SchemeShare,a.Money,Share,DetailMoney,SchemeWinMoney, WinMoneyNoWithTax, ").Append("a.DateTime,a.SchemeID,QuashStatus,Buyed,AssureMoney,BuyedShare,IsOpened,b.Memo from ").Append("(select * from V_BuyDetailsWithQuashedAll where UserID = " + base._User.ID.ToString() + " and UserID<>InitiateUserID) a left join (select SchemeID,Memo from T_UserDetails where ").Append("OperatorType = 9 and UserID = " + base._User.ID.ToString() + ")b on a.SchemeID = b.SchemeID)a order by DateTime desc"); cacheAsDataTable = MSSQL.Select(builder.ToString(), new MSSQL.Parameter[0]); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60); } string filterExpression = "1=1"; if (this.ddlLottery.SelectedValue != "-1") { filterExpression = filterExpression + " and LotteryID=" + _Convert.StrToInt(this.ddlLottery.SelectedValue, -1).ToString(); } if (this.ddlPlayType.SelectedValue != "-1") { filterExpression = filterExpression + " and PlayTypeID = " + _Convert.StrToInt(this.ddlPlayType.SelectedValue, -1).ToString(); } DataTable dt = cacheAsDataTable.Clone(); foreach (DataRow row in cacheAsDataTable.Select(filterExpression, "[DateTime] desc")) { dt.Rows.Add(row.ItemArray); } PF.DataGridBindData(this.gHistory, dt, this.gPagerHistory); this.gPagerHistory.Visible = true; this.lblPageBuySum.Text = PF.GetSumByColumn(dt, 8, true, this.gPagerHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblPageSumWinMoney.Text = PF.GetSumByColumn(dt, 10, true, this.gPagerHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblBuySum.Text = PF.GetSumByColumn(dt, 8, false, this.gPagerHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); this.lblSumWinMoney.Text = PF.GetSumByColumn(dt, 10, false, this.gPagerHistory.PageSize, this.gPagerHistory.PageIndex).ToString("N"); }
private void BindUserPayData() { if (base._User != null) { string key = "Room_UserPayDetail_" + base._User.ID.ToString(); DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { cacheAsDataTable = new Views.V_UserPayDetails().Open("ID,[DateTime],PayType,[Money],FormalitiesFees", "[UserID] = " + base._User.ID.ToString() + " and Result = 1", "[DateTime] desc, [ID]"); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试(732)", base.GetType().FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60); } this.gUserPay.DataSource = cacheAsDataTable; this.gUserPay.DataBind(); this.lblUserPayCount.Text = cacheAsDataTable.Rows.Count.ToString(); this.lblUserPayMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 3, false, this.gUserPay.PageSize, 0).ToString("N"); } }
private void BindDataReward() { if (base._User != null) { string key = "Invest_Reward_" + base._User.ID.ToString(); DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { cacheAsDataTable = new Views.V_BuyDetailsWithQuashedAll().Open("UserID, SchemeID, LotteryNumber, IsuseName, SchemeWinMoney, LotteryName, WinMoneyNoWithTax,DetailMoney", "[UserID] = " + base._User.ID.ToString() + " and EndTime < GetDate() and WinMoneyNoWithTax > 0", "[DateTime] desc, [ID]"); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试(732)", base.GetType().FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0xe10); } this.gReward.DataSource = cacheAsDataTable; this.gReward.DataBind(); this.lblRewardCount.Text = cacheAsDataTable.Rows.Count.ToString(); this.lblRewardMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 6, false, this.gReward.PageSize, 0).ToString("N"); } }
private void BindDistills() { if (base._User != null) { string key = "Home_Room_DistillDetail_" + base._User.ID.ToString(); DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { cacheAsDataTable = new Views.V_UserDistills().Open("ID,[DateTime],[Money],FormalitiesFees,Result,Memo", "[UserID] = " + base._User.ID.ToString(), "[DateTime] desc, [ID]"); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试(732)", base.GetType().FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60); } this.gUserDistills.DataSource = cacheAsDataTable; this.gUserDistills.DataBind(); this.lblDistillCount.Text = cacheAsDataTable.Rows.Count.ToString(); this.lblDistillMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 2, false, this.gUserDistills.PageSize, 0).ToString("N"); } }
private void BindData() { string str = " a.[UserID] = " + base._User.ID.ToString() + " and (EndTime < GetDate() or StartTime < GetDate()) "; if (this.ddlLottery.SelectedValue != "-1") { str = str + " and LotteryID=" + _Convert.StrToInt(this.ddlLottery.SelectedValue, -1).ToString(); } if (this.ddlPlayType.SelectedValue != "-1") { str = str + " and PlayTypeID = " + _Convert.StrToInt(this.ddlPlayType.SelectedValue, -1).ToString(); } if (str != "") { str = str + " and isAutoFollowScheme = 1"; } else { str = "isAutoFollowScheme = 1"; } DataTable dt = MSSQL.Select("select a.*,b.Memo from V_BuyDetailsWithQuashedAll a left join (select Memo,SchemeID from T_UserDetails where OperatorType = 9)b on a.SchemeID = b.SchemeID where " + str + " order by a.ID desc", new MSSQL.Parameter[0]); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", "Room_InvestHistory"); } else { PF.DataGridBindData(this.g, dt, this.gPager); this.gPager.Visible = true; this.lblPageBuyMoney.Text = PF.GetSumByColumn(dt, 10, true, this.gPager.PageSize, this.gPager.PageIndex).ToString("N"); this.lblPageReward.Text = PF.GetSumByColumn(dt, 8, true, this.gPager.PageSize, this.gPager.PageIndex).ToString("N"); this.lblTotalBuyMoney.Text = PF.GetSumByColumn(dt, 10, false, this.gPager.PageSize, this.gPager.PageIndex).ToString("N"); this.lblTotalReward.Text = PF.GetSumByColumn(dt, 8, false, this.gPager.PageSize, this.gPager.PageIndex).ToString("N"); } }
private void BindHistoryData() { string CacheKey = "Home_Room_Invest_BindHistoryData" + _User.ID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(CacheKey); if (dt == null) { StringBuilder sb = new StringBuilder(); sb.Append(@"select a.LotteriesID as LotteryID, a.LotteriesName as LotteryName, a.ID as PlayTypeID, tu.Name as InitiateName, a.PlayTypesName as PlayTypeName, ts.Share as SchemeShare, ts.Money, tb.Share, tb.DetailMoney, ts.WinMoney as SchemeWinMoney, tb.WinMoneyNoWithTax as WinMoneyNoWithTax, tb.DateTime, ts.ID as SchemeID,tb.QuashStatus, ts.Buyed, ts.AssureMoney, ts.BuyedShare as BuyedShare, ts.isOpened as IsOpened from T_BuyDetails tb inner join T_Schemes ts on ts.ID = tb.SchemeID inner join ( select T_PlayTypes.ID, T_PlayTypes.Name as PlayTypesName, T_Lotteries.Name as LotteriesName, T_Lotteries.ID as LotteriesID from T_PlayTypes inner join T_Lotteries on T_PlayTypes.LotteryID = T_Lotteries.ID) as a on ts.PlayTypeID = a.ID inner join T_Users tu on ts.InitiateUserID = tu.ID and tb.UserID = " + _User.ID.ToString() + " order by tb.DateTime desc"); dt = Shove.Database.MSSQL.Select(sb.ToString()); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } Shove._Web.Cache.SetCache(CacheKey, dt, 60); } string Condition = "1=1"; if (ddlLottery.SelectedValue != "-1") { Condition += " and LotteryID=" + Shove._Convert.StrToInt(ddlLottery.SelectedValue, -1).ToString(); } if (ddlPlayType.SelectedValue != "-1") { Condition += " and PlayTypeID = " + Shove._Convert.StrToInt(ddlPlayType.SelectedValue, -1).ToString(); } DataTable dtData = dt.Clone(); foreach (DataRow dr in dt.Select(Condition, "[DateTime] desc")) { dtData.Rows.Add(dr.ItemArray); } PF.DataGridBindData(gHistory, dtData, gPagerHistory); gPagerHistory.Visible = true; //页面总计 this.lblPageBuySum.Text = PF.GetSumByColumn(dtData, 8, true, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblPageSumWinMoney.Text = PF.GetSumByColumn(dtData, 10, true, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); //总计 this.lblBuySum.Text = PF.GetSumByColumn(dtData, 8, false, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblSumWinMoney.Text = PF.GetSumByColumn(dtData, 10, false, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); }
private void BindDataInvestHistory() { if (_User == null) { return; } string CacheKey = "Home_Room_Invest_BindHistoryData" + _User.ID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(CacheKey); if (dt == null) { StringBuilder sb = new StringBuilder(); sb.Append("select * from (select LotteryID,LotteryName,PlayTypeID,InitiateName,PlayTypeName, ") .Append("SchemeShare,a.Money,b.Share,b.DetailMoney,SchemeWinMoney, b.WinMoneyNoWithTax,a.DateTime, ") .Append("b.SchemeID,QuashStatus,Buyed,AssureMoney,BuyedShare,IsOpened,c.Memo from ") .Append("(select UserID,SchemeID,SUM(Share) as Share,SUM(DetailMoney) as DetailMoney, ") .Append("sum(WinMoneyNoWithTax) as WinMoneyNoWithTax from V_BuyDetailsWithQuashedAll ") .Append("where UserID = " + _User.ID.ToString() + " and InitiateUserID = UserID group by SchemeID,UserID)b ") .Append("left join (select * from V_BuyDetailsWithQuashedAll where UserID = " + _User.ID.ToString() + " and ") .Append("UserID = InitiateUserID and isWhenInitiate = 1)a ") .Append("on a.UserID = b.UserID and ") .Append("a.SchemeID = b.SchemeID left join (select SchemeID,Memo from T_UserDetails where ") .Append("OperatorType = 9 and UserID = " + _User.ID.ToString() + ") c ") .Append("on b.SchemeID = c.SchemeID union select LotteryID,LotteryName,PlayTypeID,InitiateName, ") .Append("PlayTypeName,SchemeShare,a.Money,Share,DetailMoney,SchemeWinMoney, WinMoneyNoWithTax, ") .Append("a.DateTime,a.SchemeID,QuashStatus,Buyed,AssureMoney,BuyedShare,IsOpened,b.Memo from ") .Append("(select * from V_BuyDetailsWithQuashedAll where UserID = " + _User.ID.ToString() + " and UserID<>InitiateUserID) a left join (select SchemeID,Memo from T_UserDetails where ") .Append("OperatorType = 9 and UserID = " + _User.ID.ToString() + ")b on a.SchemeID = b.SchemeID)a order by DateTime desc"); dt = Shove.Database.MSSQL.Select(sb.ToString()); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } Shove._Web.Cache.SetCache(CacheKey, dt, 60); } gInvestHistory.DataSource = dt; gInvestHistory.DataBind(); //总计 this.lblBuySum.Text = PF.GetSumByColumn(dt, 8, false, gInvestHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblSumWinMoney.Text = PF.GetSumByColumn(dt, 9, false, gInvestHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblMySumWinMoney.Text = PF.GetSumByColumn(dt, 10, false, gInvestHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); double winSum = Shove._Convert.StrToDouble(this.lblSumWinMoney.Text, 0); //中奖总额 double buySum = Shove._Convert.StrToDouble(this.lblBuySum.Text, 0); //购买总额 double winMoney = winSum - buySum; if (winMoney <= 0) { this.lblSumWinProfitPoints.Text = "0.00"; } else { double winRate = winMoney / buySum; if (winRate > 1) { this.lblSumWinProfitPoints.Text = Math.Round(winRate, 2).ToString("N") + "倍"; } else { this.lblSumWinProfitPoints.Text = (Math.Round(winRate, 2) * 100).ToString("N") + "%"; } } lbgInvestHistoryMessage.Text = "显示 10 条,共 " + dt.Rows.Count.ToString() + " 条记录 ,<span class=\"blue12_line\"><a href='InvestHistory.aspx'>[查看全部记录]</a></span>"; }
private void BindHistoryData() { string CacheKey = "Home_Room_Invest_BindHistoryData" + _User.ID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(CacheKey); if (dt == null) { StringBuilder sb = new StringBuilder(); sb.Append("select * from (select LotteryID,LotteryName,PlayTypeID,InitiateName,PlayTypeName, ") .Append("SchemeShare,a.Money,b.Share,b.DetailMoney,SchemeWinMoney, b.WinMoneyNoWithTax,a.DateTime, ") .Append("b.SchemeID,QuashStatus,Buyed,AssureMoney,BuyedShare,IsOpened,c.Memo from ") .Append("(select UserID,SchemeID,SUM(Share) as Share,SUM(DetailMoney) as DetailMoney, ") .Append("sum(WinMoneyNoWithTax) as WinMoneyNoWithTax from V_BuyDetailsWithQuashedAll ") .Append("where UserID = " + _User.ID.ToString() + " and InitiateUserID = UserID group by SchemeID,UserID)b ") .Append("left join (select * from V_BuyDetailsWithQuashedAll where UserID = " + _User.ID.ToString() + " and ") .Append("UserID = InitiateUserID and isWhenInitiate = 1)a ") .Append("on a.UserID = b.UserID and ") .Append("a.SchemeID = b.SchemeID left join (select SchemeID,Memo from T_UserDetails where ") .Append("OperatorType = 9 and UserID = " + _User.ID.ToString() + ") c ") .Append("on b.SchemeID = c.SchemeID union select LotteryID,LotteryName,PlayTypeID,InitiateName, ") .Append("PlayTypeName,SchemeShare,a.Money,Share,DetailMoney,SchemeWinMoney, WinMoneyNoWithTax, ") .Append("a.DateTime,a.SchemeID,QuashStatus,Buyed,AssureMoney,BuyedShare,IsOpened,b.Memo from ") .Append("(select * from V_BuyDetailsWithQuashedAll where UserID = " + _User.ID.ToString() + " and UserID<>InitiateUserID) a left join (select SchemeID,Memo from T_UserDetails where ") .Append("OperatorType = 9 and UserID = " + _User.ID.ToString() + ")b on a.SchemeID = b.SchemeID)a order by DateTime desc"); dt = Shove.Database.MSSQL.Select(sb.ToString()); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } Shove._Web.Cache.SetCache(CacheKey, dt, 60); } string Condition = "1=1"; if (ddlLottery.SelectedValue != "-1") { Condition += " and LotteryID=" + Shove._Convert.StrToInt(ddlLottery.SelectedValue, -1).ToString(); } if (ddlPlayType.SelectedValue != "-1") { Condition += " and PlayTypeID = " + Shove._Convert.StrToInt(ddlPlayType.SelectedValue, -1).ToString(); } DataTable dtData = dt.Clone(); foreach (DataRow dr in dt.Select(Condition, "[DateTime] desc")) { dtData.Rows.Add(dr.ItemArray); } PF.DataGridBindData(gHistory, dtData, gPagerHistory); gPagerHistory.Visible = true; //页面总计 this.lblPageBuySum.Text = PF.GetSumByColumn(dtData, 8, true, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblPageSumWinMoney.Text = PF.GetSumByColumn(dtData, 10, true, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); //总计 this.lblBuySum.Text = PF.GetSumByColumn(dtData, 8, false, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); this.lblSumWinMoney.Text = PF.GetSumByColumn(dtData, 10, false, gPagerHistory.PageSize, gPagerHistory.PageIndex).ToString("N"); }