private void GG() { IList <lgk.Model.tb_agent1> list = new lgk.BLL.tb_agent1().GetModelList(""); DropDownList2.Items.Clear(); ListItem li = new ListItem(); li.Value = "0"; li.Text = "-请选择-"; DropDownList2.Items.Add(li); foreach (lgk.Model.tb_agent1 item in list) { ListItem items = new ListItem(); items.Value = userBLL.GetUserID(item.AgentCode).ToString(); items.Text = item.AgentCode; DropDownList2.Items.Add(items); } }
/// <summary> /// 在页面Page_Load事件执行结束后执行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PageBase_Load(object sender, System.EventArgs e) { //结算系统和网站共用域名,当前根目录被移到/jsxt下 string strNewUrl = Request.Url.ToString().Replace("/user/finance/", "/").Replace("/user/business/", "/").Replace("/user/Info/", "/").Replace("/user/member/", "/").Replace("/user/team/", "/").Replace("/user/product/", "/").Replace("/user/shop/", "/").Replace("/user/Cash/", "/").Replace("/user/Mall/", "/").Replace("/user/", "/"); //取得当前的外网 strNewUrl = strNewUrl.Substring(0, strNewUrl.LastIndexOf("/") + 1); //当前页面的根路径 //检测Session["User"] 是否存在,如果存在,把它转换成UserInfo类,如果不存在,初始化一个UserInfo类,并存储到Session["User"] if (Request.Cookies["A128076_user"] == null) { Response.Write("<script>alert('请登录!');window.top.location='" + strNewUrl + "Login.aspx'</script>"); Response.End(); } LoginUser = userBLL.GetModel(getLoginID()); if (LoginUser == null) { Response.Write("<script>alert('请登录!');window.top.location='" + strNewUrl + "Login.aspx'</script>"); Response.End(); } Loginagent = new lgk.BLL.tb_agent().GetModel(LoginUser == null ? " userid=0" : (" userid =" + LoginUser.UserID)); Loginagent1 = new lgk.BLL.tb_agent1().GetModel(LoginUser == null ? " userid=0" : (" userid =" + LoginUser.UserID)); Language = Request.Cookies["Culture"].Value == null?"zh-cn":Request.Cookies["Culture"].Value; }