static void Main(string[] args) { Console.WriteLine("Type path of excel file:\n"); string path = @Console.ReadLine(); var dataReader = new ExcelDataReader(path); var dictionary = dataReader.getDataEntry(); foreach (KeyValuePair<string, DataEntry> pair in dictionary) { Console.WriteLine("{0} {1}", pair.Key, pair.Value.Hours + " " + pair.Value.Price); } Console.ReadLine(); }
static void Main(string[] args) { var variable = args[0]; //Console.WriteLine("Type path of excel file:\n"); string path = @variable; Log.Instance.LogPath = @"C:\Users\Bianca\Desktop\monitorLog"; Log.Instance.LogFileName = "LogFile"; Log.WriteLine(DateTime.Now + " " + "Creating new data reader."); var dataReader = new ExcelDataReader(path); Log.WriteLine(DateTime.Now + " " + "New data reader created."); Log.WriteLine(DateTime.Now + " " + "Starting excel data reader."); var dictionary = dataReader.getDataEntry(); Log.WriteLine(DateTime.Now + " " + "Spreadsheet data has been added to dictionary successfully."); foreach (KeyValuePair<string, DToolsRow> pair in dictionary) { /* Console.WriteLine(pair.Key.ToString() + " " + //pair.Value.First + " " pair.Value.ProductSKU + " " + pair.Value.ProductManufacturer + " " + pair.Value.ProductModel + " " + pair.Value.ProductDescription + " " + pair.Value.ProductClientDescription + " " + pair.Value.ProductQuantity + " " + pair.Value.ProductCost + " " + pair.Value.ProductMargin + " " + pair.Value.ProductMarkup + " " + pair.Value.ProductPrice + " " + pair.Value.NetUnitPrice + " " + pair.Value.Discount + " " + pair.Value.ProductLocation + " " + pair.Value.ProductSubSystem + " " + pair.Value.ProductWireLength + " " + pair.Value.ProductInstallationPhase + " " + pair.Value.ProductRackMount + " " + pair.Value.Type); */ } Console.WriteLine("succeeded"); Console.ReadLine(); }