private void InitializeDataProcess() { List<Product> initProductLists = new List<Product>(); DatasheetParser datasheetParser = new DatasheetParser(); //pre-load the default datasheet string startupPath = Environment.CurrentDirectory; string defaultDatasheetFileName = startupPath.Replace("bin\\Debug", "") + @"..\datasheet.xlsx"; datasheetParser.LoadDataSheetFile(defaultDatasheetFileName, out initProductLists); //append to the global list productLists.AddRange(initProductLists); }
private void InitializeDataProcess() { List <Product> initProductLists = new List <Product>(); DatasheetParser datasheetParser = new DatasheetParser(); //pre-load the default datasheet string startupPath = Environment.CurrentDirectory; string defaultDatasheetFileName = startupPath.Replace("bin\\Debug", "") + @"..\datasheet.xlsx"; datasheetParser.LoadDataSheetFile(defaultDatasheetFileName, out initProductLists); //append to the global list productLists.AddRange(initProductLists); }
private void LoadDatasheet() { DatasheetParser datasheetParser = new DatasheetParser(); List<Product> newProductLists = new List<Product>(); using (OpenFileDialog openFileDialog1 = new OpenFileDialog()) { openFileDialog1.Filter = "All Excel Files(*.xlsx)|*.xlsx"; if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string datasheetFileName = openFileDialog1.FileName.ToString(); datasheetParser.LoadDataSheetFile(datasheetFileName, out newProductLists); //append the new product list to the existing one productLists.AddRange(newProductLists); //todo: show product list //todo: show datasheet } } }
private void LoadDatasheet() { DatasheetParser datasheetParser = new DatasheetParser(); List <Product> newProductLists = new List <Product>(); using (OpenFileDialog openFileDialog1 = new OpenFileDialog()) { openFileDialog1.Filter = "All Excel Files(*.xlsx)|*.xlsx"; if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string datasheetFileName = openFileDialog1.FileName.ToString(); datasheetParser.LoadDataSheetFile(datasheetFileName, out newProductLists); //append the new product list to the existing one productLists.AddRange(newProductLists); //todo: show product list //todo: show datasheet } } }