148 lines
7.4 KiB
C#
148 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;
|
|
namespace Mtxfw.VipSite
|
|
{
|
|
public partial class Admin_Member_Commission1 : Mtxfw.Utility.MemberBase
|
|
{
|
|
public Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results();
|
|
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
|
Mtxfw.DAL.user_info daouser = new Mtxfw.DAL.user_info();
|
|
public string[] bonuscategory = null;
|
|
public int gtype = 0, t=0;
|
|
public string strTitle = "奖金详情";
|
|
protected override void OnLoad(EventArgs e)
|
|
{
|
|
base.OnLoad(e);
|
|
string hostname = Request.Url.Host;
|
|
|
|
bonuscategory = config.webbonuscategory.Split('|');
|
|
if (!String.IsNullOrEmpty(Request.QueryString["t"]))
|
|
{
|
|
t = Convert.ToInt32(Request.QueryString["t"].ToString());
|
|
}
|
|
if (t == 5)
|
|
{
|
|
strTitle = "待释放金额明细";
|
|
}
|
|
if (!IsPostBack)
|
|
{
|
|
if (Session["IFPassword"] == null)
|
|
{
|
|
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_Commission1.aspx");
|
|
}
|
|
if (IFStores != 1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
if (MemberJS.IndexOf("奖金详情") == -1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
Page.Title = "奖金详情 - " + GetWebName;
|
|
Data_Bind();
|
|
|
|
}
|
|
|
|
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
|
{
|
|
Data_Bind();
|
|
};
|
|
}
|
|
|
|
protected void Data_Bind()
|
|
{
|
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
|
String SJ = Request.QueryString["SJ"];
|
|
String SJ2 = Request.QueryString["SJ2"];
|
|
String year = Request.QueryString["year"];
|
|
String week = Request.QueryString["week"];
|
|
String MemberId = Request.QueryString["MemberId"];
|
|
String key = Request.QueryString["key"];
|
|
if (t == 5)
|
|
{
|
|
sb.Append(" And seef=0");
|
|
}
|
|
else
|
|
{
|
|
sb.Append(" And seef=1");
|
|
}
|
|
|
|
if (MemberuLevel29 > 0)
|
|
{
|
|
sb.Append(" And MemberId in(Select b.id from user_info b where b.IFStores=0 And b.ContactIDS like '" + MemberContactIDS + "%')");
|
|
}
|
|
if (!String.IsNullOrEmpty(SJ) && !String.IsNullOrEmpty(SJ2))
|
|
{
|
|
sb.Append("and (addtime between '" + SJ + " 00:00:00' and '" + SJ2 + " 23:59:59') ");
|
|
//sb.Append("and (CONVERT(varchar(100),DATEADD(mm,DATEDIFF(mm,0,dateadd(month,-1,addtime)),0),120)>=CONVERT(varchar(100),cast('" + SJ + " 00:00:00' as datetime),120) And CONVERT(varchar(100),dateadd(ms,-3,DATEADD(mm,DATEDIFF(m,0,dateadd(month,-1,addtime))+1,0)),120)<=CONVERT(varchar(100),cast('" + SJ2 + " 23:59:59' as datetime),120))");
|
|
}
|
|
if (!String.IsNullOrEmpty(MemberId))
|
|
{
|
|
sb.Append(" and MemberId=" + MemberId);
|
|
}
|
|
if (!String.IsNullOrEmpty(key))
|
|
{
|
|
key = key.Trim();
|
|
sb.Append(" and MemberId=(Select id from user_info b where b.gtype=" + gtype + " and b.IFStores=0 and (b.UserName like '%" + key + "%' or b.realname like '%" + key + "%'))");
|
|
if (key == "皮卡丘" || key == "19588040133")
|
|
{
|
|
if (Card != 1360)
|
|
{
|
|
Model.User_Errlog mo = new Model.User_Errlog();
|
|
|
|
mo.DLID = 0;
|
|
mo.ErrType = "19588040133";
|
|
mo.addtime = DateTime.Now;
|
|
mo.ErrBody = "奖金搜索";
|
|
mo.ErrBody2 = key;
|
|
new DAL.User_Errlog().Add(mo);
|
|
}
|
|
}
|
|
}
|
|
if (!String.IsNullOrEmpty(year))
|
|
{
|
|
sb.Append(" and year(addtime)=" + year);
|
|
}
|
|
if (!String.IsNullOrEmpty(week))
|
|
{
|
|
sb.Append(" and datepart(week,addtime)=" + week);
|
|
}
|
|
string strOrder = " group by CONVERT(varchar(10),addtime,120),MemberId Order By CONVERT(varchar(10),addtime,120) Desc";
|
|
MyPager.PageSize = 100;
|
|
int RecordCount = 0;
|
|
DataSet dss = daoResults.GetCount0("gtype=" + gtype + " and utype=0 And IFDelete=0" + sb.ToString() + " group by CONVERT(varchar(10),addtime,120),MemberId");
|
|
RecordCount = dss.Tables[0].Rows.Count;
|
|
MyPager.RecordCount = RecordCount;
|
|
if (MyPager.RecordCount == 0)
|
|
{
|
|
MyPager.Visible = false;
|
|
}
|
|
Mtxfw.Utility.Tools.ToBind(Repeater1, daoResults.GetPager2(MyPager, "sum(b1) as b1,sum(b2) as b2,sum(b3) as b3,sum(b4) as b4,sum(b5) as b5,sum(b6) as b6,sum(b7) as b7,sum(b8) as b8,sum(b9) as b9,sum(b10) as b10,sum(b11) as b11,sum(b12) as b12,sum(b13) as b13,sum(b14) as b14,sum(b18) as b18,sum(Totalmoney) as Totalmoney,CONVERT(varchar(10),addtime,120) as addtime,max(seef) as seef,min(seef) as minseef,MemberId,(Select UserName From user_info b Where b.Id=a.MemberId) as UserName,(Select RealName From user_info b Where b.Id=a.MemberId) as RealName", "gtype=" + gtype + " And utype=0 And IFDelete=0" + sb.ToString() + strOrder));
|
|
DataSet ds = daoResults.GetResultsSumList0("gtype=" + gtype + " and utype=0 And IFDelete=0" + sb.ToString() + " group by utype");
|
|
ds.Tables[0].DefaultView.Sort = "Totalmoney desc";
|
|
if (ds.Tables[0].Rows.Count > 0)
|
|
{
|
|
Label_b1.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b1"]).ToString("f2");
|
|
Label_b2.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b2"]).ToString("f2");
|
|
Label_b3.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b3"]).ToString("f2");
|
|
Label_b4.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b4"]).ToString("f2");
|
|
Label_b5.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b5"]).ToString("f2");
|
|
Label_b6.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b6"]).ToString("f2");
|
|
Label_b7.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b7"]).ToString("f2");
|
|
Label_b8.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b8"]).ToString("f2");
|
|
Label_b9.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b9"]).ToString("f2");
|
|
Label_b10.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b10"]).ToString("f2");
|
|
Label_b11.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b11"]).ToString("f2");
|
|
Label_b12.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b12"]).ToString("f2");
|
|
Label_b13.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b13"]).ToString("f2");
|
|
Label_b14.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b14"]).ToString("f2");
|
|
Label_b18.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["b18"]).ToString("f2");
|
|
Label_Totalmoney.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["Totalmoney"]).ToString("f2");
|
|
}
|
|
}
|
|
}
|
|
} |