Files
g.hnyhua.cn/Mtxfw.VipSite/Admin_Member_Networkmap.aspx.cs
2026-02-07 15:48:27 +08:00

190 lines
7.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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_Networkmap : Mtxfw.Utility.MemberBase
{
public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
protected static Mtxfw.Utility.Config config = new Mtxfw.Utility.Config();
public int StrID = 0, IFNoData = 0;
protected string[] Colors = { "#ABF295", "#F6E206", "#EB8675", "#1EC8A6", "#F54219", "#f283f1", "#acc5f7" };
protected string struLevels = "", SJ = "", SJ2 = "", sycUserName = "", sUserName = "";
public int gtype = 0;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
string hostname = Request.Url.Host;
gtype = new DAL.host().GetId(hostname);
Page.Title = "网络图谱 - " + GetWebName;
try
{
if (Session["IFPassword"] == null)
{
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_news.aspx");
}
if (IFStores != 1)
{
Mtxfw.Utility.Tools.Message("您没有权限!", "/");
}
string[] HFHEnable = config.HFHEnable.Split(',');
foreach (KeyValuePair<int, string> kv in Mtxfw.Utility.Common.GetuLevels())
{
if (kv.Key == 0 && HFHEnable.Length > 0)
{
if (HFHEnable[0] == "1")
{
struLevels += "<td width=\"50\" align=\"center\" bgcolor=\"" + Colors[kv.Key] + "\">" + kv.Value + "</td>";
}
}
if (kv.Key == 1 && HFHEnable.Length > 1)
{
if (HFHEnable[1] == "1")
{
struLevels += "<td width=\"50\" align=\"center\" bgcolor=\"" + Colors[kv.Key] + "\">" + kv.Value + "</td>";
}
}
if (kv.Key == 2 && HFHEnable.Length > 2)
{
if (HFHEnable[2] == "1")
{
struLevels += "<td width=\"50\" align=\"center\" bgcolor=\"" + Colors[kv.Key] + "\">" + kv.Value + "</td>";
}
}
if (kv.Key == 3 && HFHEnable.Length > 3)
{
if (HFHEnable[3] == "1")
{
struLevels += "<td width=\"50\" align=\"center\" bgcolor=\"" + Colors[kv.Key] + "\">" + kv.Value + "</td>";
}
}
if (kv.Key == 4 && HFHEnable.Length > 4)
{
if (HFHEnable[4] == "1")
{
struLevels += "<td width=\"50\" align=\"center\" bgcolor=\"" + Colors[kv.Key] + "\">" + kv.Value + "</td>";
}
}
if (kv.Key == 5 && HFHEnable.Length > 5)
{
if (HFHEnable[5] == "1")
{
struLevels += "<td width=\"50\" align=\"center\" bgcolor=\"" + Colors[kv.Key] + "\">" + kv.Value + "</td>";
}
}
if (kv.Key == 6 && HFHEnable.Length > 6)
{
if (HFHEnable[6] == "1")
{
struLevels += "<td width=\"50\" align=\"center\" bgcolor=\"" + Colors[kv.Key] + "\">" + kv.Value + "</td>";
}
}
}
StrID = Card;
if (IFStores == 1)
{
StrID = 68;
if (Session["IFPassword"] == null)
{
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_Networkmap.aspx");
}
}
else
{
if (config.JDTPEnable == "1")
{
Response.Redirect("/index.aspx");
}
if (Session["IFPassword"] == null)
{
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_Networkmap.aspx");
}
}
if (!String.IsNullOrEmpty(Request.QueryString["UserName"]))
{
sUserName = Request.QueryString["UserName"].ToString().Trim();
string strId = daoUser.Getzd("id", "gtype=" + gtype + " and UserName='" + sUserName + "'").ToString();
if (strId != "")
{
StrID = int.Parse(strId);
}
else
{
IFNoData = 1;
}
}
else
{
if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
{
StrID = int.Parse(Request.QueryString["ID"].ToString());
}
sUserName = daoUser.Getzd("UserName", "id=" + StrID + "").ToString();
if (sUserName == "")
{
IFNoData = 1;
}
}
if (!String.IsNullOrEmpty(Request.QueryString["SJ"]))
{
SJ = Request.QueryString["SJ"].ToString();
}
if (!String.IsNullOrEmpty(Request.QueryString["SJ2"]))
{
SJ2 = Request.QueryString["SJ2"].ToString();
}
Mtxfw.Model.user_info model = daoUser.GetModel(Card);
if (model != null)
{
string strSuperiorsIDS = daoUser.Getzd("SuperiorsIDS", "id=" + StrID).ToString();
if (strSuperiorsIDS != "")
{
if (Card != StrID)
{
sycUserName = daoUser.Getzd("UserName", "id=(Select SuperiorsID From User_Info b where b.id=" + StrID + ")").ToString();
}
/*if (model.SuperiorsIDS != "")
{
strSuperiorsIDS = strSuperiorsIDS.Replace(model.SuperiorsIDS, "");
}
string[] stra = strSuperiorsIDS.Split(',');
if (stra.Length >= 13)
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('此用户在10层之外不能查询');location.replace('/Admin_Member_Networkmap.aspx')</script>");
}*/
}
}
}
catch (Exception err)
{
Mtxfw.Utility.Common.WriteHtml("/weixin/Admin_Member_Networkmaperr.txt", err.ToString());
}
}
protected string Ccolor(int uLevel4)
{
string str = Colors[uLevel4];
return str;
}
protected string Ccolor0(string uLevel7)
{
string str = Colors[Convert.ToInt32(uLevel7)];
return str;
}
protected string Ccolor2(string userstate, string uLevel)
{
string str = (userstate == "未审核" ? "#f6edca" : Colors[Convert.ToInt32(uLevel)]);//
return str;
}
}
}