Ejemplo n.º 1
0
        public void xulytimkiem(ref QuanLyXe ql)
        {
            bool home;

            do
            {
                home = false;
                switch (MenuTimkiem())
                {
                case 1:
                    Console.Write("Nhập biển số xe cần tìm kiếm:");
                    string bsx = Console.ReadLine();
                    Xe     xe  = ql.TimKiemTheoBienSoXe(bsx);
                    if (xe == null)
                    {
                        Console.WriteLine("KHÔNG TÌM THẤY!");
                    }
                    ql.hienBSX(xe);
                    Console.ReadKey(); break;

                case 2:
                    Console.Write("Nhập tên nhà xe cần tìm kiếm:");
                    string    ten     = Console.ReadLine();
                    List <Xe> listtmp = ql.TimKiemTheoTenNhaXe(ten);
                    if (ten == null)
                    {
                        Console.WriteLine("KHÔNG TÌM THẤY!");
                    }
                    ql.hienList(listtmp);
                    Console.ReadKey(); break;

                case 3:
                    Console.Write("Nhập lộ trình cần tìm kiếm:");
                    string    lt      = Console.ReadLine();
                    List <Xe> Lotrinh = ql.TimKiemTheoLoTrinh(lt);
                    if (lt == null)
                    {
                        Console.WriteLine("KHÔNG TÌM THẤY!");
                    }
                    ql.hienList(Lotrinh);
                    Console.ReadKey(); break;

                case 4:
                    Console.Write("Nhập thời gian cần tìm kiếm:");
                    string    tg       = Console.ReadLine();
                    List <Xe> thoigian = ql.TimKiemTheoThoiGianXB(tg);
                    if (tg == null)
                    {
                        Console.WriteLine("KHÔNG TÌM THẤY!");
                    }
                    ql.hienList(thoigian);
                    Console.ReadKey(); break;

                case 5: home = true; break;

                case 6: Environment.Exit(0); Console.ReadKey(); break;
                }
            } while (home == false);
        }