예제 #1
0
파일: Form1.cs 프로젝트: rebbit/ScriptTools
 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);
 }
예제 #2
0
        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);
        }
예제 #3
0
파일: Form1.cs 프로젝트: rebbit/ScriptTools
        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

                }
            }
        }
예제 #4
0
        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
                }
            }
        }