using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using System.Data; namespace Mtxfw.VipSite { public partial class Admin_Member_tj : Mtxfw.Utility.MemberBase { Mtxfw.DAL.user_bank daoBank = new Mtxfw.DAL.user_bank(); Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info(); Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results(); public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(""); protected String strWeiXin = "", strQQ = "", conut1="0", conut2="0", conut3="0"; public int gtype = 0; #region 判断页面是否刷新 private bool _refreshState; private bool _isRefresh; /// /// 判断页面是否刷新 /// 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; if (!IsPostBack) { Page.Title = "每天业绩统计 - " + GetWebName; strQQ = config.webQQ; strWeiXin = config.webWeiXin; Data_Bind(); } if (Session["IFPassword"] == null) { Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_tj.aspx"); } if (IFStores != 1) { Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx"); } if (MemberJS.IndexOf("每天业绩统计") == -1) { Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx"); } MyPager.PageChanged += delegate(object s, EventArgs ex) { Data_Bind(); }; } protected void Data_Bind() { System.Text.StringBuilder sb = new System.Text.StringBuilder(); //sb.Append(" and MemberId=" + Card); String SJ = Request.QueryString["SJ"]; String SJ2 = Request.QueryString["SJ2"]; if (!String.IsNullOrEmpty(SJ) && !String.IsNullOrEmpty(SJ2)) { sb.Append(" and (regtime between '" + SJ + " 00:00:00' and '" + SJ2 + " 23:59:59')"); } sb.Append(" and userstate='正常' and IFStores=0"); string strOrder = " group by CONVERT(varchar(10),regtime,120) Order By CONVERT(varchar(10),regtime,120) Desc"; MyPager.PageSize = 100; MyPager.RecordCount = daoUser.GetList2("count(id) as TotalCount, sum(umoney21) as umoney21,CONVERT(varchar(10),regtime,120) as regtime", "gtype=" + gtype + " and uutype='0'" + sb.ToString() + strOrder).Tables[0].Rows.Count; Mtxfw.Utility.Tools.ToBind(Repeater1, daoUser.GetPager2(MyPager, "count(id) as TotalCount,(Select Count(b.id) From user_info b Where CONVERT(varchar(10),b.regtime,120)=CONVERT(varchar(10),max(a.regtime),120) And uLevel7=1 And IFStores=0) as TotalCount2,sum(umoney21) as umoney21,CONVERT(varchar(10),regtime,120) as regtime", "gtype=" + gtype + " and uutype='0'" + sb.ToString() + strOrder)); DataSet ds = daoUser.GetList1("count(id) as TotalCount,(Select Count(b.id) From user_info b Where uLevel7=1 And IFStores=0) as TotalCount2,sum(umoney21) as umoney21", "gtype=" + gtype + " and utype=0" + sb.ToString()); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["TotalCount"].ToString() != "") { conut1 = ds.Tables[0].Rows[0]["TotalCount"].ToString(); } if (ds.Tables[0].Rows[0]["TotalCount2"].ToString() != "") { conut2 = ds.Tables[0].Rows[0]["TotalCount2"].ToString(); } if (ds.Tables[0].Rows[0]["umoney21"].ToString() != "") { conut3 = Convert.ToDouble(ds.Tables[0].Rows[0]["umoney21"]).ToString("f2"); } } } } }