Ejemplo n.º 1
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        Model.Helpcate mh     = new Model.Helpcate();
        BLL.Helpcate   bh     = new BLL.Helpcate();
        int            result = 0;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");

            if (cb.Checked)
            {
                mh.ID  = Convert.ToInt32(GridView1.DataKeys[i].Value);
                result = bh._delete(mh);
            }
        }
        if (result > 0)
        {
            Response.Write("<script>alert('删除成功'),location.href='helpcatelist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('删除失败'),location.href='helpcatelist.aspx'</script>");
        }
    }
Ejemplo n.º 2
0
    protected void up()
    {
        Model.Helpcate mh = new Model.Helpcate();
        mh.ID = Convert.ToInt32(Request.QueryString["uid"]);
        BLL.Helpcate bh = new BLL.Helpcate();

        MySqlDataReader dr = bh.sqlDataReader(mh);
        if (dr.Read())
        {
            Label1.Text = dr["_cateid"].ToString();
            name.Text = dr["_catename"].ToString();
        }
        dr.Close();
    }
Ejemplo n.º 3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Model.Helpcate mh = new Model.Helpcate();
     BLL.Helpcate bn = new BLL.Helpcate();
     mh.Catename = TextBox1.Text;
     int result = bn.insert(mh);
     if (result > 0)
     {
         Response.Write("<script>alert('添加成功'),location.href='helpcatelist.aspx'</script>");
     }
     else
     {
         Response.Write("<script>alert('添加失败'),location.href='helpcatelist.aspx'</script>");
     }
 }
Ejemplo n.º 4
0
 protected void 提交_Click(object sender, EventArgs e)
 {
     Model.Helpcate mh = new Model.Helpcate();
     mh.ID = Convert.ToInt32(Request.QueryString["uid"]);
     mh.Catename = name.Text;
     BLL.Helpcate bh = new BLL.Helpcate();
     int result = bh.update(mh);
     if (result > 0)
     {
         Response.Write("<script>alert('更新成功'),location.href='helpcatelist.aspx'</script>");
     }
     else
     {
         Response.Write("<script>alert('更新失败'),location.href='helpcatelist.aspx'</script>");
     }
 }
Ejemplo n.º 5
0
    protected void up()
    {
        Model.Helpcate mh = new Model.Helpcate();
        mh.ID = Convert.ToInt32(Request.QueryString["uid"]);
        BLL.Helpcate bh = new BLL.Helpcate();


        SqlDataReader dr = bh.sqldatareader(mh);

        if (dr.Read())
        {
            Label1.Text = dr["_cateid"].ToString();
            name.Text   = dr["_catename"].ToString();
        }
        dr.Close();
    }
Ejemplo n.º 6
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Model.Helpcate mh = new Model.Helpcate();
        BLL.Helpcate   bn = new BLL.Helpcate();
        mh.Catename = TextBox1.Text;
        int result = bn.insert(mh);

        if (result > 0)
        {
            Response.Write("<script>alert('添加成功'),location.href='helpcatelist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('添加失败'),location.href='helpcatelist.aspx'</script>");
        }
    }
Ejemplo n.º 7
0
    protected void 提交_Click(object sender, EventArgs e)
    {
        Model.Helpcate mh = new Model.Helpcate();
        mh.ID       = Convert.ToInt32(Request.QueryString["uid"]);
        mh.Catename = name.Text;
        BLL.Helpcate bh     = new BLL.Helpcate();
        int          result = bh.update(mh);

        if (result > 0)
        {
            Response.Write("<script>alert('更新成功'),location.href='helpcatelist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('更新失败'),location.href='helpcatelist.aspx'</script>");
        }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int         id          = Convert.ToInt32(Request.QueryString["id"]);
        BLLHelpcate bllhelpcate = new BLLHelpcate();
        DataSet     ds          = bllhelpcate.select();

        Repeater1.DataSource = ds;
        Repeater1.DataBind();

        DataSet ds2 = bllhelpcate.select(id);

        Repeater3.DataSource = ds2;
        Repeater3.DataBind();


        BLLhelp bllhelp = new BLLhelp();
        DataSet ds1     = bllhelp.selectAll(id);

        Repeater2.DataSource = ds1;
        Repeater2.DataBind();


        Model.Helpcate helpcate = new Model.Helpcate();
        helpcate.ID = id;

        SqlDataReader sdr = bllhelpcate.sqldatareader(helpcate);

        if (sdr.Read())
        {
            Page.Title = sdr["_catename"].ToString();
        }
        else
        {
            sdr.Close();
            if (Label1.Text == "个人注册及信息管理")
            {
                Response.Write(Label1.Text);
                Page.Title = "个人注册及信息管理";
            }
        }
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request.QueryString["id"]);
        BLLHelpcate bllhelpcate = new BLLHelpcate();
        DataSet ds = bllhelpcate.select();
        Repeater1.DataSource = ds;
        Repeater1.DataBind();

        DataSet ds2 = bllhelpcate.select(id);
        Repeater3.DataSource = ds2;
        Repeater3.DataBind();

        BLLhelp bllhelp = new BLLhelp();
        DataSet ds1 = bllhelp.selectAll(id);
        Repeater2.DataSource = ds1;
        Repeater2.DataBind();

           Model.Helpcate helpcate=new Model.Helpcate();
        helpcate.ID=id;

        MySqlDataReader sdr = bllhelpcate.sqldatareader(helpcate);
        if (sdr.Read())
        {
            Page.Title = sdr["_catename"].ToString();

        }
        else
        {
            sdr.Close();
            if (Label1.Text == "个人注册及信息管理")
            {
                Response.Write(Label1.Text);
                Page.Title = "个人注册及信息管理";

            }
        }
    }
Ejemplo n.º 10
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        Model.Helpcate mh = new Model.Helpcate();
        BLL.Helpcate bh = new BLL.Helpcate();
        int result = 0;
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");

            if (cb.Checked)
            {
                mh.ID = Convert.ToInt32(GridView1.DataKeys[i].Value);
                result = bh._delete(mh);
            }
        }
        if (result > 0)
        {
            Response.Write("<script>alert('删除成功'),location.href='helpcatelist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('删除失败'),location.href='helpcatelist.aspx'</script>");
        }
    }