Exemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Ketnoi kn = new Ketnoi();
            int    kq = kn.xulydulieu("Insert into Khach_Hang(MaKH,TenKH,DiaChi,Email,SDT) values ('" + txtMaKH.Text + "','" + txtTenKH.Text + "','" + txtDiaChi.Text + "','" + txtEmail.Text + "','" + txtSdt.Text + "')");

            if (kq > 0)
            {
                lblthongbao.Text = "Bạn thêm thành công !!";
                laybangchogridview();
            }
            else
            {
                lblthongbao.Text = "Bạn thêm không thành công !!, Hãy kiểm tra lại !";
            }
        }
Exemplo n.º 2
0
        protected void cmdSua_Click(object sender, EventArgs e)
        {
            Ketnoi kn = new Ketnoi();
            int    kq = kn.xulydulieu("Update Khach_Hang set TenKH='" + txtTenKH.Text + "', DiaChi='" + txtDiaChi.Text + "', Email='" + txtEmail.Text + "',SDT='" + txtSdt.Text + "' where MaKH='" + txtMaKH.Text + "'");

            if (kq > 0)
            {
                lblthongbao.Text = "Bạn sữa thành công !!";
                laybangchogridview();
            }
            else
            {
                lblthongbao.Text = "Bạn sữa không thành công !!, Kiểm tra lại !";
            }
        }
Exemplo n.º 3
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            Ketnoi kn = new Ketnoi();
            int    kq = kn.xulydulieu("Update San_Pham set TenSP='" + txtTenSP.Text + "', DonViTinh='" + txtDVT.Text + "', DonGia='" + txtDG.Text + "',GhiChu='" + txtGC.Text + "' where MaSP='" + txtMaSP.Text + "'");

            if (kq > 0)
            {
                lblthongbao2.Text = "Bạn sữa thành công !!";
                laybangchogridview2();
            }
            else
            {
                lblthongbao2.Text = "Bạn sữa không thành công !!, Kiểm tra lại !";
            }
        }
Exemplo n.º 4
0
        protected void Button1_Click1(object sender, EventArgs e)
        {
            Ketnoi kn = new Ketnoi();
            int    kq = kn.xulydulieu("Insert into San_Pham(MaSP,TenSP,DonViTinh,DonGia,GhiChu) values ('" + txtMaSP.Text + "','" + txtTenSP.Text + "','" + txtDVT.Text + "','" + txtDG.Text + "','" + txtGC.Text + "')");

            if (kq > 0)
            {
                lblthongbao2.Text = "Bạn thêm thành công !!";
                laybangchogridview2();
            }
            else
            {
                lblthongbao2.Text = "Bạn thêm không thành công !!, Hãy kiểm tra lại !";
            }
        }
Exemplo n.º 5
0
        protected void cmdCo_Click(object sender, EventArgs e)
        {
            Ketnoi kn = new Ketnoi();
            int    kq = kn.xulydulieu("Delete Khach_Hang where MaKH='" + txtMaKH.Text + "'");

            if (kq > 0)
            {
                lblthongbao.Text = "Bạn xóa thành công !";

                laybangchogridview();
                cmdCo.Visible    = false;
                cmdKhong.Visible = false;

                txtMaKH.Text   = "";
                txtTenKH.Text  = "";
                txtDiaChi.Text = "";
                txtEmail.Text  = "";
                txtSdt.Text    = "";
            }
        }
Exemplo n.º 6
0
        protected void mCo_Click(object sender, EventArgs e)
        {
            Ketnoi kn = new Ketnoi();
            int    kq = kn.xulydulieu("Delete San_Pham where MaSP='" + txtMaSP.Text + "'");

            if (kq > 0)
            {
                lblthongbao2.Text = "Bạn xóa thành công !";

                laybangchogridview2();
                cCo.Visible    = false;
                cKhong.Visible = false;

                txtMaSP.Text  = "";
                txtTenSP.Text = "";
                txtDVT.Text   = "";
                txtDG.Text    = "";
                txtGC.Text    = "";
            }
        }