diff options
author | Serghei Cebotari <51533848+schebotar@users.noreply.github.com> | 2022-01-28 18:20:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 18:20:30 +0300 |
commit | ec1d38f2d4926ddd89dc8f17d29617ea4ddefa82 (patch) | |
tree | 9fd3a44e58693dc9bbc8d0e406ba4de21b39ec86 /src/PriceListTools/AbstractPriceListTool.cs | |
parent | d688578a46e3a3383371c1df952fa2898c828a9a (diff) | |
parent | 2ad016bb4c332ecad6d12d824a84f15616ecea38 (diff) |
Merge pull request #12 from schebotar/dev
Dev
Diffstat (limited to 'src/PriceListTools/AbstractPriceListTool.cs')
-rw-r--r-- | src/PriceListTools/AbstractPriceListTool.cs | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/PriceListTools/AbstractPriceListTool.cs b/src/PriceListTools/AbstractPriceListTool.cs deleted file mode 100644 index 1aef0be..0000000 --- a/src/PriceListTools/AbstractPriceListTool.cs +++ /dev/null @@ -1,65 +0,0 @@ -using ExcelDna.Integration; -using Microsoft.Office.Interop.Excel; -using System; -using System.Collections.Generic; - -namespace RehauSku.PriceListTools -{ - internal abstract class AbstractPriceListTool - { - protected private Application ExcelApp; - protected private PriceList NewPriceList; - protected private List<PriceList> sourcePriceLists; - - public AbstractPriceListTool() - { - ExcelApp = (Application)ExcelDnaUtil.Application; - sourcePriceLists = new List<PriceList>(); - } - - public void OpenNewPrice(string path) - { - Workbook wb = ExcelApp.Workbooks.Open(path); - - try - { - NewPriceList = new PriceList(wb); - - if (NewPriceList.Sheets.Count == 0) - throw new ArgumentException($"Не найдены листы с артикулами в {wb.Name}"); - - if (NewPriceList.OfferSheet == null) - throw new ArgumentException($"Нет листа для коммерческого предложения в {wb.Name}"); - } - - catch (Exception ex) - { - wb.Close(); - throw ex; - } - } - - public virtual void GetSource() - { - throw new NotImplementedException(); - } - - public virtual void GetSource(string[] files) - { - ExcelApp.ScreenUpdating = false; - foreach (string file in files) - { - Workbook wb = ExcelApp.Workbooks.Open(file); - PriceList priceList = new PriceList(wb); - sourcePriceLists.Add(priceList); - wb.Close(); - } - ExcelApp.ScreenUpdating = true; - } - - public virtual void FillPriceList() - { - throw new NotImplementedException(); - } - } -}
\ No newline at end of file |