Exemplo n.º 1
0
        DanhSachAnPham TimAnPhamTheoGiaTien(int x)
        {
            DanhSachAnPham kq = new DanhSachAnPham();

            kq.collection = collection.FindAll(a => a.GiaTien == x);
            return(kq);
        }
Exemplo n.º 2
0
        public DanhSachAnPham TimAnPhamCoGiaCaoNhat()
        {
            float          max = collection.Max(x => x.GiaTien);
            DanhSachAnPham kq  = new DanhSachAnPham();

            kq.collection = collection.FindAll(x => x.GiaTien == max);
            return(kq);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            DanhSachAnPham ds = new DanhSachAnPham();

            ds.NhapTuFile();
            Console.WriteLine(ds);
            ds.SapXepTheoTen();

            //Console.WriteLine(" An pham co gia cao nhat " + ds.TimAnPhamCoGiaCaoNhat());
            Console.WriteLine("Sap xep theo ten \n" + ds);
            ds.SapXepTheoGia();
            Console.WriteLine("Sap xep theo gia\n" + ds);
            Console.ReadKey();
        }