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_Networkmap2 : Mtxfw.Utility.MemberBase { public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(""); public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info(); protected string strID = "0", SJ = "", SJ2 = "", sUserName = "", sycUserName="", SuperiorsIDS = "", strFrist = "", strUrl = ""; public int gtype = 0, InitID = 68; protected override void OnLoad(EventArgs e) { base.OnLoad(e); string hostname = Request.Url.Host; if (gtype == 1) { InitID = 69; } else if (gtype == 1) { InitID = 70; } try { if (Session["IFPassword"] == null) { Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_news.aspx"); } if (IFStores != 1) { Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx"); } if (!String.IsNullOrEmpty(Request.QueryString["SJ"])) { SJ = Request.QueryString["SJ"].ToString(); } if (!String.IsNullOrEmpty(Request.QueryString["SJ2"])) { SJ2 = Request.QueryString["SJ2"].ToString(); } if (!IsPostBack) { Page.Title = "推荐图谱 - " + config.webName; strID = Card.ToString(); if (IFStores == 1 || IFStores == 2) { strID = InitID.ToString(); if (Session["IFPassword"] == null) { Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_Networkmap2.aspx"); } } else { if (config.TJTPEnable == "1") { Response.Redirect("/index.aspx"); } if (Session["IFPassword"] == null) { Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_Networkmap2.aspx"); } } if (!String.IsNullOrEmpty(Request.QueryString["id"])) { strID = Request.QueryString["id"].ToString(); } if (!String.IsNullOrEmpty(Request.QueryString["UserName"])) { String key = HttpUtility.UrlDecode(Request.QueryString["UserName"]); DataSet Dss = daoUser.GetList1("id", " IFStores=0 And (UserName like '%" + key + "%' or RealName like '%" + key + "%' or Phone like '%" + key + "%')"); if (Dss.Tables[0].Rows.Count>0) { strID = Dss.Tables[0].Rows[0]["Id"].ToString(); } Dss.Clear(); } Mtxfw.Model.user_info model = daoUser.GetModel(int.Parse(strID)); if (model != null) { if (model.ContactID > 0) { Mtxfw.Model.user_info model2 = daoUser.GetModel(model.ContactID); if (model2 != null) { sycUserName = model2.UserName; } } sUserName = model.UserName; SuperiorsIDS = model.ContactIDS; string strtime = model.RegTime.ToString(); string struLevel = Mtxfw.Utility.Common.GetuLevelname(model.uLevel); //struLevel += " " + Mtxfw.Utility.Common.GetuLevel4name(model.uLevel4); string ListType = ""; int ccount = daoUser.GetCount("gtype=" + gtype + " and IFStores=0 And userstate='正常' and uLevel17=0 and ContactID=" + model.Id + ""); int acount = daoUser.GetCount("gtype=" + gtype + " and IFStores=0 And userstate='正常' and uLevel17=0 and ContactIDS like '" + model.ContactIDS + model.Id + ",%'"); if (ccount > 0) { ListType = "点击展开"; } Double zyj = model.umoney19; if (SJ != "" && SJ2 != "") { string mindt = SJ + " 00:00:00"; string maxdt = SJ2 + " 23:59:59"; string strzd = new Mtxfw.DAL.user_Results_jl2().Getzd("sum(Addmoney)", "gtype=" + gtype + " and utype=8 and utype2=0 and IFDelete=0 And addtime>='" + mindt + "' and addtime<='" + maxdt + "' And MemberId in(select b.id from user_info b where b.IFStores=0 And b.userstate='正常' and b.uLevel14=1 and b.ContactIDS like '" + (model.ContactIDS != "" ? model.ContactIDS + model.Id + "," : "," + model.Id + ",") + "%')").ToString(); if (strzd != "") { zyj = Convert.ToDouble(strzd); } } Double zcount = 0.00; Double maxzcount = 0.00; Double minzcount = 0.00; DataSet dss = daoUser.GetList1("id,umoney19,umoney21", "gtype=" + gtype + " and IFStores=0 And userstate='正常' and uLevel17=0 and ContactID=" + model.Id + ""); if (dss.Tables[0].Rows.Count > 0) { foreach (System.Data.DataRow Drr in dss.Tables[0].Rows) { int aid = Convert.ToInt32(Drr["id"]); Double umoney19 = Convert.ToDouble((Convert.ToDouble(Drr["umoney19"].ToString())+Convert.ToDouble(Drr["umoney21"].ToString())).ToString("f2")); zcount += umoney19; if (maxzcount == 0.00) { maxzcount = umoney19; } else { if (maxzcount < umoney19) { maxzcount = umoney19; } } } } dss.Clear(); minzcount = (zcount - maxzcount); string UserName = model.UserName; if (model.SJRememberID > 0) { UserName = "[" + Mtxfw.Utility.Common.GetTem(model.SJRememberID) + "]" + UserName; } int IFqiandao = 0; DataSet qdds = new DAL.qiandao().getqiandao(gtype, model.Id); if (qdds.Tables[0].Rows.Count > 0) { IFqiandao = Convert.ToInt32(qdds.Tables[0].Rows[0]["IFqiandao"].ToString()); } qdds.Clear(); strFrist = "" + ListType + UserName + "" + model.RealName + "" + struLevel + "第0代" + ccount + "" + acount + "" + zyj.ToString() + "" + (model.uLevel14 == 0 ? "未激活" : "已激活") + "" + model.RegTime + " ";//" + acount + "" + zyj.ToString() + " } } } catch (Exception err) { Mtxfw.Utility.Common.WriteHtml("/weixin/Admin_Member_Networkmap2err.txt", err.ToString()); } } } }