コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //ViewState=Consultion_Info
        if (!IsPostBack)
        {
            if (Session["UserInfo"] == null)
            {
                if (Request.Cookies["UserConfig"] == null)
                {
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    HttpCookie cookie = Request.Cookies["UserConfig"];
                    Diya       diya   = new Diya();
                    Session["UserInfo"] = Server.HtmlEncode(diya.GetDESDecrypt(cookie.Value));
                }
            }
            if (Session["TheScene"] != null)
            {
                switch (Convert.ToInt32(Session["TheScene"].ToString()))
                {
                case 1: BindScene1();
                    break;

                case 2: BindScene2();
                    break;

                case 3: BindScene3();
                    break;

                case 4: BindScene4();
                    break;

                case 5: BindScene5();
                    break;

                case 6: BindScene6();
                    break;

                case 7: BindScene7();
                    break;

                default:
                    break;
                }
                Session["TheScene"] = null;
            }
            string[] Info = Session["UserInfo"].ToString().Split(new char[] { '#' });
            Diya.GetUserInfo(Convert.ToInt32(Info[0]), Info[1], Info[2]);
            this.landinfo.Text           = Info[2];
            ViewState["Consultion_Info"] = new Diya().Gridviewbind(this.Consultion, "Select ChildrenCall,ParentsCall,Contact,Contactid from ConsultingInfo ");
            if (this.ClassInfo != null)
            {
                ClassInfo.ClearSelection();
                ClassInfo.Items.Clear();
            }
            ListItem item = new ListItem("全部班级", "0");
            item.Selected = true;
            MySqlDataReader read = new Diya().RowReader("Select ClassID,ClassName From classinfo order by ClassID asc");
            while (read.Read())
            {
                item = new ListItem(read["ClassName"].ToString(), read["ClassID"].ToString());
                this.ClassInfo.Items.Add(item);
            }
        }
    }