private async void LoadDataFromFile() { _maxPrimka = UraPrimke.Count > 0 ? UraPrimke.Max(y => y.BrojUKnjiziUra) : 0; OpenFileDialog ofd = new OpenFileDialog { Filter = "Xlsx Files *.xlsx|*.xlsx|Xls Files *.xls|*.xls|Csv files *.csv|*.csv", FilterIndex = 1, Multiselect = false }; bool?result = ofd.ShowDialog(); if (result != null && result == true) { IsLoading = true; FilePath = ofd.FileName; var data = _xlsFileReader.Convert(FilePath, _bookName); if (data != null) { FromStringToList(data); _loaded = true; } await Application.Current.Dispatcher.BeginInvoke(new Action(DatagridLoaded), DispatcherPriority.ContextIdle, null); } }
private async void LoadDataFromFile() { _maxRedniBroj = RetailItems.Count > 0 ? RetailItems.Max(y => y.RedniBroj) : 0; OpenFileDialog ofd = new OpenFileDialog { Filter = "Xlsx Files *.xlsx|*.xlsx|Xls Files *.xls|*.xls|Csv files *.csv|*.csv", FilterIndex = 1, Multiselect = false }; Nullable <bool> result = ofd.ShowDialog(); if (result != null && result == true) { IsLoading = true; FilePath = ofd.FileName; var data = _xlsFileReader.Convert(FilePath, "REKAPITULACIJA POREZA SVEUKUPNO"); if (data != null) { FromStringToList(data); _loaded = true; } await Application.Current.Dispatcher.BeginInvoke(new Action(DatagridLoaded), DispatcherPriority.ContextIdle, null); } }
private async void LoadDataFromFileAsync() { OpenFileDialog ofd = new OpenFileDialog { Filter = "Xls Files *.xls|*.xls|Xlsx Files *.xlsx|*.xlsx|Csv files *.csv|*.csv", FilterIndex = 1, Multiselect = false }; Nullable <bool> result = ofd.ShowDialog(); string filepath; if (result != null && result == true) { IsLoading = true; filepath = ofd.FileName; var data = _xlsFileReader.Convert(filepath, "Hrvatski zavod"); if (data != null) { FromStringToList(data); } await Application.Current.Dispatcher.BeginInvoke(new Action(DatagridLoaded), DispatcherPriority.ContextIdle, null); } }
private void LoadDataFromFile() { _maxPrimka = UraPrimke.Count > 0 ? UraPrimke.Max(y => y.BrojUKnjiziUra) : 0; OpenFileDialog ofd = new OpenFileDialog { Filter = "Xlsx Files *.xlsx|*.xlsx|Xls Files *.xls|*.xls|Csv files *.csv|*.csv", FilterIndex = 1, Multiselect = false }; Nullable <bool> result = ofd.ShowDialog(); if (result != null && result == true) { FilePath = ofd.FileName; var data = _xlsFileReader.Convert(FilePath, _bookName); if (data != null) { FromStringToList(data); _loaded = true; } } }
private void LoadDataFromFile() { _maxRedniBroj = BookItems.Count > 0 ? BookItems.Max(y => y.Id) : 0; OpenFileDialog ofd = new OpenFileDialog { Filter = "Xlsx Files *.xlsx|*.xlsx|Xls Files *.xls|*.xls|Csv files *.csv|*.csv", FilterIndex = 1, Multiselect = false }; Nullable <bool> result = ofd.ShowDialog(); if (result != null && result == true) { FilePath = ofd.FileName; var data = _xlsFileReader.Convert(FilePath, "PREGLED PROMETA BLAGAJNE"); if (data != null) { FromStringToList(data); _loaded = true; } } }