예제 #1
0
 public void Restock()
 {
     try
     {
         using (StreamReader sr = new StreamReader(this.ReadPath))
         {
             while (!sr.EndOfStream)
             {
                 string   line      = sr.ReadLine();
                 string[] lineArray = line.Split("|");
                 Product  product   = new Product(lineArray[1], double.Parse(lineArray[2]), lineArray[3]);
                 CurrentProductStock.Add(lineArray[0], product);
                 SalesReport.Add(product.Name, 0);
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }