Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ketNoi.DbConnection();
            ketNoi.updateToDataBase("update hoadon set thanhtoan='1' where tenkh='" + HD.tenKH + "' and ngay='" + HD.ngay + "' and gio='" + HD.gio + "' and giomuon='" + HD.gioMuon + "'");
            this.ParentForm.Hide();
            XuatHDSan hd = new XuatHDSan();

            hd.ShowDialog();
            this.ParentForm.Close();
        }
        private void btnDat_Click(object sender, EventArgs e)
        {
            DU.tenDU = cbbNuocUong.Text;
            DU.sL    = comboBox1.Text;
            ketNoi.DbConnection();
            string sql  = "insert INTO hoadondu(tendu,soluong) values('" + cbbNuocUong.Text + "','" + comboBox1.Text + "')";
            string sql2 = "update douong set ton=ton-" + comboBox1.Text + " where tendu='" + cbbNuocUong.Text + "'";

            ketNoi.updateToDataBase(sql);
            ketNoi.updateToDataBase(sql2);
            this.ParentForm.Hide();
            XuatHDSan hd = new XuatHDSan();

            hd.ShowDialog();
            this.ParentForm.Close();
        }