protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dbConfig configDB = new dbConfig(); string gUserName = configDB.getUserName(User.Identity.Name); string gIP = Request.ServerVariables["Remote_Addr"]; string gContent = "线索分析"; common.setLog(User.Identity.Name, gUserName, gIP, gContent); cblHost.DataSource = configDB.getSites(User.Identity.Name); cblHost.DataBind(); FormInit(); } }
/// <summary> /// 根据用户ID返回用户能访问的所有节点,没有则返回NULL /// </summary> /// <param name="userID">用户ID</param> /// <returns>户能访问的所有节点,没有则返回NULL</returns> public static string GetHosrList(string userID) { dbConfig dbHost = new dbConfig(); DataSet ds = dbHost.getSites(userID); StringBuilder bul = new StringBuilder("'0'"); if (ds == null || ds.Tables.Count <= 0) { return null; } foreach (DataRow row in ds.Tables[0].Rows) { bul.Append(",'"); bul.Append(row["nId"].ToString()); bul.Append("'"); } return bul.ToString(); }
/// <summary> /// 对单位进行初始化 /// </summary> private void initSite() { dbConfig dbHost = new dbConfig(); cblHost.DataSource = dbHost.getSites(User.Identity.Name); cblHost.DataBind(); }
protected void formInit() { sdate.MaxDate = DateTime.Today.AddDays(-1); edate.MaxDate = DateTime.Today.AddDays(-1); sdate.Value = Session["FromDate"]; edate.Value = Session["ToDate"]; dbConfig dbHost = new dbConfig(); cblHost.DataSource = dbHost.getSites(User.Identity.Name); cblHost.DataBind(); }
/// <summary> /// 对窗体控件初始化 /// </summary> protected void formInit() { sdate.MaxDate = DateTime.Today.AddDays(-1); edate.MaxDate = DateTime.Today.AddDays(-1); sdate.Value = Session["FromDate"]; edate.Value = Session["ToDate"]; #region 绑定要查询的单位 dbConfig dbHost = new dbConfig(); cblHost.DataSource = dbHost.getSites(User.Identity.Name); cblHost.DataBind(); #endregion #region 绑定木马黑名单数据 this.ddlHorselist.DataSource = dbHost.GetHorseList(); this.ddlHorselist.DataTextField = "vName"; this.ddlHorselist.DataValueField = "vName"; this.ddlHorselist.DataBind(); this.ddlHorselist.Items.Insert(0, new ListItem("选择所有", "0")); #endregion }