protected void Button1_Click(object sender, EventArgs e)
 {
     Model.H_User    user    = new Model.H_User();
     Model.H_Student student = new Model.H_Student();
     user.username           = this.TextUser.Value.Trim();
     user.password           = this.TextPwd.Value.Trim();
     user.qxid               = 4;
     user.isoccupy           = 1;
     student.username        = this.TextUser.Value.Trim();
     student.name            = this.TextName.Value.Trim();
     student.email           = this.TextEmail.Value.Trim();
     student.telphone        = this.TextTel.Value.Trim();
     student.zhifubao        = this.TextZhifubao.Value.Trim();
     student.bank            = this.TextBank.Value.Trim();
     student.bank_name       = this.TextBank_name.Value.Trim();
     student.bank_num        = this.TextBank_number.Value.Trim();
     student.region_province = this.HiddenProvince.Value.ToString();
     student.region_city     = this.HiddenCity.Value.ToString();
     student.region_county   = this.HiddenArea.Value.ToString();
     if (H_UserClass.Add(user) && H_StudentClass.Add(student))
     {
         JScript.Alert("操作成功", "a2", this);
         Response.Redirect("AdminLogin.aspx");
     }
     else
     {
         JScript.Alert("操作失败", "a2", this);
     }
 }
Beispiel #2
0
        private void InitData()
        {
            string     strWhere = " 1=1 ";
            HttpCookie cookie   = Request.Cookies["qx"];

            if (cookie != null)
            {
                qx = cookie.Values["qxid"].ToString();
            }
            if (qx == "4")
            {
                string username = HttpUtility.UrlDecode(cookie.Values["user"].ToString(), Encoding.UTF8);
                strWhere = "username='******'";
            }
            if (qx == "3")
            {
                Response.Redirect("Error.aspx");
            }
            int PageIndex = 1;

            if (Request.QueryString["page"] != null)
            {
                int.TryParse(Request.QueryString["page"].ToString(), out PageIndex);
            }

            int PageSize   = 10;
            int TotalCount = 0;

            DataTable dt = H_StudentClass.GetList(PageSize, PageIndex, strWhere, out TotalCount);

            this.Repeater1.DataSource = dt;
            this.Repeater1.DataBind();
            this.LiteralPage.Text = PageClass.BuildPage(PageIndex, TotalCount, PageSize);
        }
        private void InitData()
        {
            if (Request.QueryString["pid"] != null)
            {
                string          pid     = Request.QueryString["pid"].ToString();
                Model.H_Student student = H_StudentClass.GetModel(pid);

                this.TextName.Value        = student.name;
                this.TextEmail.Value       = student.email;
                this.TextTel.Value         = student.telphone;
                this.TextZhifubao.Value    = student.zhifubao;
                this.TextBank.Value        = student.bank;
                this.TextBank_name.Value   = student.bank_name;
                this.TextBank_number.Value = student.bank_num;
            }
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     Model.H_Student student = new Model.H_Student();
     student.id              = int.Parse(Request.QueryString["pid"]);
     student.name            = this.TextName.Value.Trim();
     student.username        = H_StudentClass.GetModel(Request.QueryString["pid"].ToString()).username;
     student.email           = this.TextEmail.Value.Trim();
     student.telphone        = this.TextTel.Value.Trim();
     student.zhifubao        = this.TextZhifubao.Value.Trim();
     student.bank            = this.TextBank.Value.Trim();
     student.bank_name       = this.TextBank_name.Value.Trim();
     student.bank_num        = this.TextBank_number.Value.Trim();
     student.region_province = H_StudentClass.GetModel(Request.QueryString["pid"].ToString()).region_province;
     student.region_city     = H_StudentClass.GetModel(Request.QueryString["pid"].ToString()).region_city;
     student.region_county   = H_StudentClass.GetModel(Request.QueryString["pid"].ToString()).region_county;
     if (H_StudentClass.Update(student))
     {
         JScript.AlertAndRedirect("操作成功!", "StudentList.aspx", this);
     }
     else
     {
         JScript.AlertAndRedirect("操作失败!", "a2", this);
     }
 }