diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2022-01-27 10:22:30 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2022-01-27 10:22:30 +0300 |
commit | 72ac236b15603e84f18ec346749186b6cb2c2bdf (patch) | |
tree | bf47c7f4e92e1008fe1b4a34851b642d15ee0c98 /src/PriceListTools/AbstractPriceListTool.cs | |
parent | 8e3dff1788905c203509f866921957b027cb2643 (diff) |
Refactoring tolls classes
Diffstat (limited to 'src/PriceListTools/AbstractPriceListTool.cs')
-rw-r--r-- | src/PriceListTools/AbstractPriceListTool.cs | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/PriceListTools/AbstractPriceListTool.cs b/src/PriceListTools/AbstractPriceListTool.cs deleted file mode 100644 index 437450c..0000000 --- a/src/PriceListTools/AbstractPriceListTool.cs +++ /dev/null @@ -1,83 +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 SourceFile NewPriceList; - protected private List<SourceFile> sourcePriceLists; - - public AbstractPriceListTool() - { - ExcelApp = (Application)ExcelDnaUtil.Application; - sourcePriceLists = new List<SourceFile>(); - } - - protected private void FilterByAmount() - { - AutoFilter filter = NewPriceList.Sheet.AutoFilter; - - filter.Range.AutoFilter(NewPriceList.amountCell.Column, "<>"); - NewPriceList.Sheet.Range["A1"].Activate(); - } - - public void OpenNewPrice(string path) - { - Workbook wb = ExcelApp.Workbooks.Open(path); - - try - { - NewPriceList = new SourceFile(wb); - } - - catch (Exception ex) - { - System.Windows.Forms.MessageBox.Show - (ex.Message, - "Ошибка открытия шаблонного прайс-листа", - System.Windows.Forms.MessageBoxButtons.OK, - System.Windows.Forms.MessageBoxIcon.Information); - wb.Close(); - } - } - - 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); - try - { - SourceFile priceList = new SourceFile(wb); - sourcePriceLists.Add(priceList); - wb.Close(); - } - catch (Exception ex) - { - System.Windows.Forms.MessageBox.Show - (ex.Message, - "Ошибка открытия исходного прайс-листа", - System.Windows.Forms.MessageBoxButtons.OK, - System.Windows.Forms.MessageBoxIcon.Information); - wb.Close(); - } - } - ExcelApp.ScreenUpdating = true; - } - - public virtual void FillPriceList() - { - throw new NotImplementedException(); - } - } -}
\ No newline at end of file |