Files
g.hnyhua.cn/Mtxfw.VipSite/Admin_Member_JJXF.aspx.cs
2026-02-07 15:48:27 +08:00

162 lines
7.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace Mtxfw.VipSite
{
public partial class Admin_Member_JJXF : Mtxfw.Utility.MemberBase
{
Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results();
Mtxfw.DAL.user_Results_jl2 daojl2 = new Mtxfw.DAL.user_Results_jl2();
protected Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
protected int IFShowXFJF = 0,Countr=0;
protected string strIFKD = "", strIFNoKD = "", zyj = "0.00", xfbl = "", xfbl2 = "", jjcze = "0.00";
protected Double zzyj = 0, zjj = 0, zfs = 0, zje = 0, mzfs = 0;
public int gtype = 0;
#region
private bool _refreshState;
private bool _isRefresh;
/// <summary>
/// 判断页面是否刷新
/// </summary>
public bool IsRefresh
{
get
{
return _isRefresh;
}
}
protected override void LoadViewState(object savedState)
{
object[] allStates = (object[])savedState;
base.LoadViewState(allStates[0]);
_refreshState = (bool)allStates[1];
_isRefresh = _refreshState == (bool)Session["__ISREFRESH"];
}
protected override object SaveViewState()
{
Session["__ISREFRESH"] = _refreshState;
object[] allStates = new object[2];
allStates[0] = base.SaveViewState();
allStates[1] = !_refreshState;
return allStates;
}
#endregion
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
string hostname = Request.Url.Host;
xfbl = config.webMoney15;
xfbl2 = config.webMoney13;
/*string stryj = daojl2.Getzd("sum(Addmoney)", "gtype="+ gtype + " and utype=3 and utype2=0 And Convert(varchar(50),BZContent)='注册币' And IFDelete=0 And DateDiff(week,addtime,getdate())=1").ToString();
if (stryj != "")
{
zyj = Convert.ToDouble(stryj).ToString();
}*/
string stryj = daoResults.Getzd("sum(b1)", "gtype="+ gtype + " and utype=0 And IFDelete=0").ToString();
if (stryj != "")
{
zjj = Convert.ToDouble(stryj);
}
stryj = daojl2.Getzd("sum(Addmoney)", "gtype=" + gtype + " and utype=3 and utype2=0 And Convert(varchar(50),BZContent)='注册币' And IFDelete=0").ToString();
if (stryj != "")
{
zzyj = Convert.ToDouble(stryj);
}
Countr = new Mtxfw.DAL.user_Results_jl3().GetCount("gtype=" + gtype + " and utype=0 And DateDiff(week,addtime,getdate())=0");
if (config.webMoney60 != "")
{
jjcze = Convert.ToDouble(config.webMoney60).ToString("f2");
}
DataSet ds = daoUser.GetList1("id,uLevel", "gtype=" + gtype + " and uutype='0' And userstate<>'未审核' And IFStores=0 And gtype=" + gtype + " And uLevel7=0");
if (ds.Tables[0].Rows.Count > 0)
{
foreach (System.Data.DataRow Dr in ds.Tables[0].Rows)
{
int dID = int.Parse(Dr["id"].ToString());
int duLevel = Convert.ToInt32(Dr["uLevel"]);
int fs = 0;
mzfs += fs;
}
}
ds.Clear();
if (!IsPostBack)
{
if (Session["IFPassword"] == null)
{
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_List.aspx");
}
if (IFStores != 1)
{
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
}
if (MemberJS.IndexOf("收益释放管理") == -1)
{
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
}
Data_Bind();
Page.Title = "收益释放管理 - " + GetWebName;
}
}
protected void Data_Bind()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
String key = HttpUtility.UrlDecode(Request.QueryString["key"]);
sb.Append("gtype=" + gtype + " and utype=3 and utype2=0 And Convert(varchar(50),BZContent)='注册币' And IFDelete=0");
if (gtype == 0)
{
if (Memberttype != -1)
{
sb.Append(" And gtype=" + Memberttype);
}
}
else
{
sb.Append(" And gtype=" + gtype);
}
//string strOrder = " group by DATEPART(year,addtime),DATEPART(month,addtime),DATEPART(week,addtime) Order By DATEPART(year,addtime) Desc,DATEPART(month,addtime) Desc,DATEPART(week,addtime) Desc";
string strOrder = " group by DATEPART(year,addtime),DATEPART(week,addtime) Order By DATEPART(year,addtime) Desc,DATEPART(week,addtime) Desc";
//DataSet ds = daojl2.GetList1("sum(Addmoney) as zumoney21,sum(Cutmoney) as zzumoney21,DATEPART(week,addtime) as week,CONVERT(varchar(10),min(addtime),120) as mintime,CONVERT(varchar(10),max(addtime),120) as maxtime,(select blmoney from user_Results_jl3 b where b.utype='1' And DATEPART(year,b.addtime)=DATEPART(year,a.addtime) And DATEPART(month,b.addtime)=DATEPART(month,a.addtime) and DATEPART(week,b.addtime)=DATEPART(week,a.addtime)) as blmoney,(select fs from user_Results_jl3 b where b.utype='1' And DATEPART(year,b.addtime)=DATEPART(year,a.addtime) And DATEPART(month,b.addtime)=DATEPART(month,a.addtime) and DATEPART(week,b.addtime)=DATEPART(week,a.addtime)) as fs", sb.ToString() + strOrder);
DataSet ds = daojl2.GetList1("sum(Addmoney) as zumoney21,sum(Cutmoney) as zzumoney21,DATEPART(week,addtime) as week,CONVERT(varchar(10),min(addtime),120) as mintime,CONVERT(varchar(10),max(addtime),120) as maxtime,(select blmoney from user_Results_jl3 b where b.utype='1' And DATEPART(year,b.addtime)=DATEPART(year,a.addtime) and DATEPART(week,b.addtime)=DATEPART(week,a.addtime)) as blmoney,(select fs from user_Results_jl3 b where b.utype='1' And DATEPART(year,b.addtime)=DATEPART(year,a.addtime) and DATEPART(week,b.addtime)=DATEPART(week,a.addtime)) as fs", sb.ToString() + strOrder);
if (ds.Tables[0].Rows.Count > 0)
{
foreach (System.Data.DataRow Dr in ds.Tables[0].Rows)
{
int fs = 0;
if (Dr["fs"].ToString() != "")
{
fs = Convert.ToInt32(Dr["fs"]);
}
zfs += fs;
Double blmoney = 0.00;
if (Dr["blmoney"].ToString() != "")
{
blmoney = Convert.ToDouble(Dr["blmoney"]);
}
zje += (((Convert.ToDouble(Dr["zumoney21"]) * blmoney / 100) / (Convert.ToDouble(Dr["zumoney21"]) / 800)) * fs);
}
}
//zfs = (zzyj / 800);
Mtxfw.Utility.Tools.ToBind(Repeater1, ds);
}
}
}