예제 #1
0
        public void AddProduct()
        {
            string      chon = string.Empty;
            Cls_Product _product;

            do
            {
                _product = new Cls_Product();
                _product.Input();
                _ListProduct.Add(_product);
                Console.WriteLine("Ban co muon nhap tiep khong Y/N");
                chon = Console.ReadLine();
            } while (chon.ToLower().Equals("y"));
        }
예제 #2
0
 public void ReadForFile(string path)
 {
     _ListProduct.Clear();
     using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
     {
         using (BinaryReader bW = new BinaryReader(fs))
         {
             Cls_Product _product;
             while (bW.PeekChar() != -1)
             {
                 _product = new Cls_Product();
                 _product.ReadForFile(bW);
                 _ListProduct.Add(_product);
             }
         }
     }
 }