Ejemplo n.º 1
0
        public void TimMa(int x, int y, ConsoleColor background_color, ConsoleColor text_color)
        {
            do
            {
                Console.BackgroundColor = background_color;
                Console.ForegroundColor = text_color;
                string     mahdn  = "";
                IHDNhapBLL hdnhap = new HDNhapBLL();
                HDNhapBLL  hdnBLL = new HDNhapBLL();

                Console.Clear();
                IO.Box(0, 0, 28, 114, ConsoleColor.Black, ConsoleColor.White);
                IO.BoxTitle("                                           TÌM KIẾM HÓA ĐƠN NHẬP", x, y, 8, 112);
                IO.Writexy("Nhập mã hóa đơn nhập cần tìm:", x + 2, y + 3);
                IO.Writexy("--------------------------------------------------------------------------------------------------------------", x + 1, y + 4);
                IO.Writexy("Nhập ! để thoát...", x + 4, y + 6);
                Hien(x + 13, y + 8, hdnhap.LayDSHDNhap(), 5, 0);

                do
                {
                    Console.SetCursorPosition(x + 32, y + 3);
                    mahdn = Console.ReadLine();
                    if (mahdn == "")
                    {
                        IO.Clear(x + 3, y + 5, 60, ConsoleColor.Black);
                        IO.Writexy("Nhập lại mã hóa đơn nhập...", x + 4, y + 5, ConsoleColor.Black, ConsoleColor.White);
                    }
                    else if (mahdn == "!")
                    {
                        return;
                    }
                    else
                    {
                        if (hdnBLL.KT_MaHDN(CongCu.ChuanHoaMa(mahdn)) == false)
                        {
                            IO.Clear(x + 3, y + 5, 60, ConsoleColor.Black);
                            IO.Writexy("Không tồn tại mã hóa đơn nhập này...", x + 4, y + 5, ConsoleColor.Black, ConsoleColor.White);
                            IO.Clear(x + 31, y + 3, 60, ConsoleColor.Black);
                        }
                        else
                        {
                            IO.Clear(x + 3, y + 5, 60, ConsoleColor.Black);
                            IO.Writexy("Hóa đơn nhập tìm được...", x + 4, y + 5);
                            mahdn = CongCu.ChuanHoaMa(mahdn);
                            List <HDNhap> list = hdnhap.TimHDNhap(new HDNhap(mahdn, null, null, null, 0));
                            Hien(x + 13, y + 8, list, 5, 1);
                        }
                    }
                } while (mahdn == "" || hdnBLL.KT_MaHDN(CongCu.ChuanHoaMa(mahdn)) == false);
            } while (true);
        }