public void Xoa(int x, int y, ConsoleColor background_color, ConsoleColor text_color) { do { Console.BackgroundColor = background_color; Console.ForegroundColor = text_color; string mahdb = ""; ICTHDBanBLL cthdban = new CTHDBanBLL(); IHDBanBLL hdban = new HDBanBLL(); HDBanBLL hdbBLL = new HDBanBLL(); Console.Clear(); IO.Box(0, 0, 28, 114, ConsoleColor.Black, ConsoleColor.White); IO.BoxTitle(" XÓA HÓA ĐƠN BÁN", x, y, 8, 110); IO.Writexy("Nhập mã hóa đơn bán cần xóa:", x + 4, y + 3); IO.Writexy("------------------------------------------------------------------------------------------------------------", x + 1, y + 4); IO.Writexy("Nhập ! để thoát...", x + 4, y + 6); Hien(x + 13, y + 8, hdban.LayDSHDBan(), 5, 0); do { Console.SetCursorPosition(x + 33, y + 3); mahdb = Console.ReadLine(); if (mahdb == "") { IO.Clear(x + 3, y + 5, 60, ConsoleColor.Black); IO.Writexy("Nhập lại mã hóa đơn bán...", x + 4, y + 5, ConsoleColor.Black, ConsoleColor.White); } else if (mahdb == "!") { return; } else { if (hdbBLL.KT_MaHDB(CongCu.ChuanHoaMa(mahdb)) == false) { IO.Clear(x + 3, y + 5, 60, ConsoleColor.Black); IO.Writexy("Không tồn tại mã hóa đơn bán này...", x + 4, y + 5, ConsoleColor.Black, ConsoleColor.White); IO.Clear(x + 32, y + 3, 60, ConsoleColor.Black); } else { mahdb = CongCu.ChuanHoaMa(mahdb); hdban.XoaHDBan(mahdb); cthdban.XoaCTHDBan(mahdb); IO.Clear(x + 3, y + 5, 60, ConsoleColor.Black); IO.Clear(x + 32, y + 3, 60, ConsoleColor.Black); IO.Writexy("Hóa đơn nhập đã được xóa...", x + 4, y + 5); Hien(x + 13, y + 8, hdban.LayDSHDBan(), 5, 1); } } } while (mahdb == "" || hdbBLL.KT_MaHDB(CongCu.ChuanHoaMa(mahdb)) == false); } while (true); }