public bool DeleteHoaDon(string mahoadon) { ChiTietHoaDonBus ctb = new ChiTietHoaDonBus(); foreach (string ct in ctb.GetMaCTHoaDonList(mahoadon)) { if (ctb.DeleteChiTietHD(ct)) { Console.WriteLine("Delete: {0}", ct); } } return(objHoaDon.DeleteRow(mahoadon)); }
public bool UpdateHoaDon(HoaDon hd) { if (objHoaDon.IsRowExists(hd.MaHoaDon)) { ChiTietHoaDonBus ctb = new ChiTietHoaDonBus(); foreach (string ct in ctb.GetMaCTHoaDonList(hd.MaHoaDon)) { if (ctb.DeleteChiTietHD(ct)) { Console.WriteLine("Delete: {0}", ct); } } return(objHoaDon.UpdateRow(hd)); } else { return(false); } }