/// <summary> /// Zapisywanie danych do pliku excela /// </summary> private void SaveExcel() { string filePath = string.Empty; SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "Excel files (*.xls;*.xlsx)|*.xls;*.xlsx"; if (saveFileDialog.ShowDialog() == true) { filePath = saveFileDialog.FileName; ReadSaveExcelService saveExcel = new ReadSaveExcelService(); saveExcel.SaveData(DataCollection, filePath); } }
/// <summary> /// Odczytywanie danych z pliku excel /// </summary> private void ImportExcel() { string filePath = string.Empty; OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Excel files (*.xls;*.xlsx)|*.xls;*.xlsx|All files (*.*)| *.*"; if (openFileDialog.ShowDialog() == true) { filePath = openFileDialog.FileName; ReadSaveExcelService readExcel = new ReadSaveExcelService(); ExcelDataCollection = new ObservableCollection<DataGps>(readExcel.LoadData(filePath)); DataCollection = new ObservableCollection<DataGps>(ExcelDataCollection); _isWindSelected = false; GetWindParameters(); _isDataFromExcel = true; ClearPlot(); if (DataCollection.Count != 0) IsAccepted = true; } }