Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["UserInfo"] == null)
            {
                if (Request.Cookies["UserConfig"] == null)
                {
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    HttpCookie cookie = Request.Cookies["UserConfig"];
                    Session["UserInfo"] = Server.HtmlEncode(new Diya().GetDESDecrypt(cookie.Value));
                }
            }
            string[] Info = Session["UserInfo"].ToString().Split(new char[] { '#' });
            Diya.GetUserInfo(Convert.ToInt32(Info[0]), Info[1], Info[2]);
            this.landinfo.Text         = Info[2];
            ViewState["UserID"]        = Info[1];
            ViewState["TestMouldInfo"] = new Diya().Gridviewbind(this.TestMouldGV, "select * from TestMouldInfo where Userid='" + ViewState["UserID"] + "' order by  MouldID desc");

            if (this.TestMouldGV.Rows.Count == 0)
            {
                this.TestMouldGV.Visible = false;
                this.NullData.Visible    = true;
            }
            else
            {
                this.TestMouldGV.Visible = true;
                this.NullData.Visible    = false;
            }
        }
    }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["UserInfo"] == null)
         {
             if (Request.Cookies["UserConfig"] == null)
             {
                 Response.Redirect("Consultion.aspx");
             }
             else
             {
                 HttpCookie cookie = Request.Cookies["UserConfig"];
                 Session["UserInfo"] = Server.HtmlEncode(new Diya().GetDESDecrypt(cookie.Value));
             }
         }
         string[] Info = Session["UserInfo"].ToString().Split(new char[] { '#' });
         Diya.GetUserInfo(Convert.ToInt32(Info[0]), Info[1], Info[2]);
         this.UserInfoTitel.Text  = Info[2];
         ViewState["ClassID"]     = Session["ClassID_A"];
         Session["ClassID_A"]     = null;
         ViewState["StudentInfo"] = new Diya().Gridviewbind(this.GW1, "Select * from ConsultingInfo");
         using (MySqlDataReader read = new Diya().RowReader("Select * From classinfo  where classinfo.Classid=" + ViewState["ClassID"]))
         {
             read.Read();
             this.ClassName_Label.Text = read["ClassName"].ToString();
         }
         DataTable Dt = new DataTable();
         for (int i = 0; i < this.GW1.Rows.Count; i++)
         {
             DataColumn Dc = new DataColumn(Convert.ToString(i) + "#");
             Dc.DefaultValue = "0";
             Dt.Columns.Add(Dc);
         }
         for (int i = 0; i < this.GW1.PageCount; i++)
         {
             Dt.Rows.Add(Dt.NewRow());
         }
         ViewState["Selection"] = Dt;
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["UserInfo"] != null)
         {
             using (MySqlDataReader read = new Diya().RowReader("Select * From classinfo Where Classid!=0"))
             {
                 while (read.Read())
                 {
                     ListItem item = new ListItem(read["ClassName"].ToString(), read["Classid"].ToString());
                     this.ClassInfo_Dorp.Items.Add(item);
                 }
             }
             string[] Info = Session["UserInfo"].ToString().Split(new char[] { '#' });
             Diya.GetUserInfo(Convert.ToInt32(Info[0]), Info[1], Info[2]);
             this.landinfo.Text = Info[2];
             if (Request["Mode"] == "Add")
             {
                 ListItem[] items = new ListItem[2];
                 items[0] = new ListItem("男", "1");
                 items[1] = new ListItem("女", "0");
                 this.Sex.Items.AddRange(items);
                 using (MySqlDataReader read = new Diya().RowReader("Select Canalid,CanalName From CanalInfo"))
                 {
                     while (read.Read())
                     {
                         ListItem item = new ListItem(read["CanalName"].ToString(), read["Canalid"].ToString());
                         this.Cannel.Items.Add(item);
                     }
                 }
             }
             else
             {
                 this.ClassInfo_Dorp.Enabled = false;//目前还没有很好的方法去更新CSRelationship表,先禁用之
                 string _id = Request["Mode"];
                 string id  = Session["ConEditInfo"].ToString();
                 ViewState["UpdateID"]  = id;
                 Session["ConEditInfo"] = null;
                 using (MySqlDataReader read = new Diya().RowReader("Select * From ConsultingInfo where Contactid=" + id))
                 {
                     read.Read();
                     this.Children_Call.Value = read["ChildrenCall"].ToString();
                     this.Parent_Call.Value   = read["ParentsCall"].ToString();
                     this.Age.Value           = read["ChildrenAge"].ToString();
                     this.ClassLV.Value       = read["ClassLv"].ToString();
                     this.Sex.Items.Add(new ListItem("男", "男"));
                     this.Sex.Items.Add(new ListItem("女", "女"));
                     if (read["ChildrenSex"].ToString() == "男")
                     {
                         this.Sex.SelectedIndex = 0;
                     }
                     else
                     {
                         this.Sex.SelectedIndex = 1;
                     }
                     this.School.Value  = read["School"].ToString();
                     this.Contact.Value = read["Contact"].ToString();
                     this.arrive.Value  = read["ReceptionTime"] == DBNull.Value ? "" : read["ReceptionTime"].ToString();
                     string Canalid = read["Canalid"].ToString();
                     using (MySqlDataReader Cread = new Diya().RowReader("select * from CanalInfo"))
                     {
                         while (Cread.Read())
                         {
                             ListItem item = new ListItem(Cread["CanalName"].ToString(), Cread["Canalid"].ToString());
                             if (item.Value == Canalid)
                             {
                                 item.Selected = true;
                             }
                             this.Cannel.Items.Add(item);
                         }
                     }
                     this.remark.Text = read["Remarks"].ToString();
                 }
             }
         }
     }
 }
Esempio n. 4
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);
            }
        }
    }