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_Commission0 : Mtxfw.Utility.MemberBase { public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(""); public Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results(); Mtxfw.DAL.user_info daouser = new Mtxfw.DAL.user_info(); public Double UpdateMoney = 0.00, Totalmoney = 0.00, b1 = 0.00, b2 = 0.00, b3 = 0.00, b4 = 0.00, b5 = 0.00, b6 = 0.00, b7 = 0.00, b11 = 0.00; 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 == 1) { strTitle = "拼团月出纳统计"; } if (!IsPostBack) { if (Session["IFPassword"] == null) { Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_Commission0.aspx"); } if (IFStores != 1) { Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx"); } if (MemberJS.IndexOf("月出纳统计") == -1) { Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx"); } Page.Title = strTitle + " - " + GetWebName; Data_Bind(); } MyPager.PageChanged += delegate(object s, EventArgs ex) { Data_Bind(); }; } protected void Data_Bind() { UpdateMoney = 0.00; Totalmoney = 0.00; b1 = 0.00; b2 = 0.00; b3 = 0.00; b4 = 0.00; b5 = 0.00; b6 = 0.00; b7 = 0.00; b11 = 0.00; System.Text.StringBuilder sb = new System.Text.StringBuilder(); String MemberId = Request.QueryString["MemberId"]; String key = Request.QueryString["key"]; String page = Request.QueryString["page"]; sb.Append(" and hasRead=" + t); 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.UserName='" + key + "')"); } string strOrder = " group by DATEPART(year,addtime),DATEPART(month,addtime) Order By DATEPART(year,addtime) Desc,DATEPART(month,addtime) Desc"; MyPager.PageSize = 100; int RecordCount = 0; DataSet dss = daoResults.GetCount0("gtype=" + gtype + " and utype=0" + sb.ToString() + strOrder); RecordCount = dss.Tables[0].Rows.Count; MyPager.RecordCount = RecordCount; if (MyPager.RecordCount == 0) { MyPager.Visible = false; } Mtxfw.Utility.Tools.ToBind(Repeater1, daoResults.GetPager2(MyPager, "min(CONVERT(varchar(10),addtime,120)) as sj1,max(CONVERT(varchar(10),addtime,120)) as sj2,(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(b11)) as b11,sum(Totalmoney) as Totalmoney,(select (sum(Addmoney)) from user_Results_jl2 b where b.gtype=" + gtype + " and b.utype=8 and b.utype2=" + t + " And b.IFDelete=0 And DATEPART(month,addtime)=DATEPART(month,a.addtime)) as UpdateMoney", "gtype=" + gtype + " and utype=0 And IFDelete=0" + sb.ToString() + strOrder)); DataSet ds = daoResults.GetList1("(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(b11)) as b11,sum(Totalmoney) as Totalmoney,(select (sum(Addmoney)) from user_Results_jl2 b where b.gtype=" + gtype + " and b.utype=8 and b.utype2=" + t + " And b.IFDelete=0) as UpdateMoney", "gtype=" + gtype + " and utype=0 And IFDelete=0" + sb.ToString()); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["Totalmoney"].ToString() != "") { Totalmoney += Convert.ToDouble(ds.Tables[0].Rows[0]["Totalmoney"]); } if (ds.Tables[0].Rows[0]["UpdateMoney"].ToString() != "") { UpdateMoney += Convert.ToDouble(ds.Tables[0].Rows[0]["UpdateMoney"]); } if (ds.Tables[0].Rows[0]["b1"].ToString() != "") { b1 += Convert.ToDouble(ds.Tables[0].Rows[0]["b1"]); } if (ds.Tables[0].Rows[0]["b2"].ToString() != "") { b2 += Convert.ToDouble(ds.Tables[0].Rows[0]["b2"]); } if (ds.Tables[0].Rows[0]["b3"].ToString() != "") { b3 += Convert.ToDouble(ds.Tables[0].Rows[0]["b3"]); } if (ds.Tables[0].Rows[0]["b4"].ToString() != "") { b4 += Convert.ToDouble(ds.Tables[0].Rows[0]["b4"]); } if (ds.Tables[0].Rows[0]["b5"].ToString() != "") { b5 += Convert.ToDouble(ds.Tables[0].Rows[0]["b5"]); } if (ds.Tables[0].Rows[0]["b6"].ToString() != "") { b6 += Convert.ToDouble(ds.Tables[0].Rows[0]["b6"]); } if (ds.Tables[0].Rows[0]["b7"].ToString() != "") { b7 += Convert.ToDouble(ds.Tables[0].Rows[0]["b7"]); } if (ds.Tables[0].Rows[0]["b11"].ToString() != "") { b11 += Convert.ToDouble(ds.Tables[0].Rows[0]["b11"]); } } } } }