Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            phong ph = new phong();

            ph.setMaPhong(textBox2.Text);
            ph.setGiaPhong(Int32.Parse(textBox3.Text));
            ph.setTinhTrang(textBox1.Text);
            ph.setLoaiPhong(textBox4.Text);

            phongBusiness pb = new phongBusiness();

            ph.setMaPhong(textBox2.Text);
            int ms = pb.them(ph);

            if (ms == 1)
            {
                MessageBox.Show("Them thanh cong");
                loadData();
            }
        }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            phong ph = new phong();

            ph.setMaPhong(textBox2.Text);
            phongBusiness pb = new phongBusiness();
            int           rm = pb.xoa(ph);

            if (rm == 1)
            {
                MessageBox.Show("Xoa thanh cong");
                loadData();
            }
        }
Example #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            phong ph = new phong();

            ph.setMaPhong(textBox2.Text); // e phai set them may cai truong kia nua chu
            ph.setTinhTrang(textBox1.Text);
            ph.setGiaPhong(Int32.Parse(textBox3.Text));
            ph.setLoaiPhong(textBox4.Text);

            phongBusiness pb = new phongBusiness();
            int           sa = pb.sua(ph);

            if (sa == 1)
            {
                MessageBox.Show("Sua thanh cong");
                loadData();
            }
        }