Example #1
0
    protected void btnSua_Click(object sender, EventArgs e)
    {
        bool tf = false;
        int  id = Convert.ToInt32(Request.QueryString["id"]);
        phuongthucthanhtoanBLL bs = new phuongthucthanhtoanBLL();

        if (bs.check(id, txtTen.Text) == false)
        {
            tf = bs.edit(id, txtTen.Text.Trim(), txtTT.Text);
            if (tf == true)
            {
                Response.Redirect("phuongthuc.aspx?edit=t");
            }
            else
            {
                lbError.Text = "<div class='error'>"
                               + "<div class='tl'></div><div class='tr'></div>"
                               + "<div class='desc'>"
                               + "<p>Sửa phương thức bị lỗi!</p>"
                               + "</div>"
                               + "<div class='bl'></div><div class='br'></div>"
                               + "</div>";
            }
        }
        else
        {
            lbTen.Text = "Tên phương thức này đã được sử dụng.";
        }
    }
Example #2
0
    // them
    private void them()
    {
        bool tf = false;
        phuongthucthanhtoanBLL bs = new phuongthucthanhtoanBLL();

        if (bs.check(txtTen.Text) == false)
        {
            tf = bs.add(txtTen.Text.Trim(), txtTT.Text);

            if (tf == true)
            {
                Response.Redirect("phuongthuc.aspx?add=t");
            }
            else
            {
                lbError.Text = "<div class='error'>"
                               + "<div class='tl'></div><div class='tr'></div>"
                               + "<div class='desc'>"
                               + "<p>Thêm phương thức bị lỗi !</p>"
                               + "</div>"
                               + "<div class='bl'></div><div class='br'></div>"
                               + "</div>";
            }
        }
        else
        {
            lbTen.Text = "Tên phương thức này đã được sử dụng.";
        }
    }