using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using System.Data; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; namespace Mtxfw.VipSite { public partial class Admin_Member_HongBao_JS : 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(); Mtxfw.DAL.user_Results_jl2 daojl2 = new Mtxfw.DAL.user_Results_jl2(); public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(""); Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article(); DAL.user_jjfp daojjfp = new DAL.user_jjfp(); public int gtype = 0, JQFHCount1=0, jsfs = 0; public string zjjc="0.00", zrhbcje="0.00", jrhbcje= "0.00", jsje ="0.00"; #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; DataSet ds = daoUser.GetList1("uLevel22", "gtype=" + gtype + " and UserState='正常' And IFStores=0 And umoney41>0 And DateDiff(day,regtime,getdate())>0"); if (ds.Tables[0].Rows.Count > 0) { JQFHCount1 = ds.Tables[0].Rows.Count; foreach (System.Data.DataRow Dr in ds.Tables[0].Rows) { jsfs += Convert.ToInt32((Convert.ToInt32(Dr["uLevel22"].ToString()) / Convert.ToInt32(config.webMoney23)).ToString().Split('.')[0]); } } jsje = (jsfs * Convert.ToDouble(config.webMoney24)).ToString("f2"); string strzd = daojl2.Getzd("sum(Addmoney)", "utype=8 and utype2=0 and IFDelete=0 and DateDiff(day,addtime,getdate())=1").ToString(); if (strzd != "") { zrhbcje = (Convert.ToDouble(strzd) * Convert.ToDouble(config.webMoney48) / 100).ToString("f2"); } /*strzd = daojl2.Getzd("sum(Addmoney)", "utype=8 and utype2=0 and IFDelete=0 and DateDiff(day,addtime,getdate())=0").ToString(); if (strzd != "") { jrhbcje = (Convert.ToDouble(strzd) * Convert.ToDouble(config.webMoney48) / 100).ToString("f2"); }*/ DataSet ds0 = daojjfp.GetList1("count1,count2", "gtype=" + gtype + " and TType=0"); if (ds0.Tables[0].Rows.Count >0) { zjjc = Convert.ToDouble(ds0.Tables[0].Rows[0]["count1"]).ToString("f2"); //jsje = Convert.ToDouble(ds0.Tables[0].Rows[0]["count2"]).ToString("f2"); } ds0.Clear(); if (!IsPostBack) { if (Session["IFPassword"] == null) { Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_HongBao_JS.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(); sb.Append(" and utype=8 and userid=0"); if (gtype == 0) { if (Memberttype != -1) { sb.Append(" And gtype=" + Memberttype); } } else { sb.Append(" And gtype=" + gtype); } string strOrder = " group by CONVERT(varchar(10),addtime,120) Order By CONVERT(varchar(10),addtime,120) Desc"; MyPager.PageSize = 100; int RecordCount = 0; DataSet dss = daoResults.GetCount0("gtype=" + gtype + " And IFDelete=0" + sb.ToString() + " group by CONVERT(varchar(10),addtime,120)"); RecordCount = dss.Tables[0].Rows.Count; MyPager.RecordCount = RecordCount; if (MyPager.RecordCount == 0) { MyPager.Visible = false; } Mtxfw.Utility.Tools.ToBind(Repeater1, daoResults.GetPager2(MyPager, "count(id) as zcount,sum(Totalmoney) as Totalmoney,CONVERT(varchar(10),addtime,120) as addtime", "gtype=" + gtype + " And IFDelete=0" + sb.ToString() + strOrder)); DataSet ds = daoResults.GetResultsSumList0("gtype=" + gtype + " And IFDelete=0" + sb.ToString() + ""); if (ds.Tables[0].Rows.Count > 0) { Label_b1.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["zcount"]).ToString(); Label_Totalmoney.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["Totalmoney"]).ToString("f2"); } } } }