Esempio n. 1
0
 private void btXoaDH_Click(object sender, EventArgs e)
 {
     if (dgvdsDonHang.SelectedRows.Count > 0)
     {
         DataRow dh = ((DataRowView)dgvdsDonHang.SelectedRows[0].DataBoundItem).Row;
         dh.Delete();
         XuLyDuLieu.ghiBang("ThongTinHoaDon", dsDonHang);
     }
 }
Esempio n. 2
0
        private void btThemDH_Click(object sender, EventArgs e)
        {
            DataRow dh = dsDonHang.NewRow();

            dh["MA_CN"]   = tbMaCN.Text;
            dh["Ma_HD"]   = tbMaDH.Text;
            dh["GIATIEN"] = tbGia.Text;


            dsDonHang.Rows.Add(dh);

            XuLyDuLieu.ghiBang("ThongTinHoaDon", dsDonHang);
        }
Esempio n. 3
0
 private void btSuaDH_Click(object sender, EventArgs e)
 {
     if (dgvdsDonHang.SelectedRows.Count > 0)
     {
         DataRow dh = ((DataRowView)dgvdsDonHang.SelectedRows[0].DataBoundItem).Row;
         dh["MA_CN"]   = tbMaCN.Text;
         dh["Ma_HD"]   = tbMaDH.Text;
         dh["GIATIEN"] = tbGia.Text;
         XuLyDuLieu.ghiBang("ThongTinHoaDon", dsDonHang);
     }
     else
     {
         MessageBox.Show("Chua Chon Don Hang", "Thong Bao", MessageBoxButtons.OK);
     }
 }