diff options
Diffstat (limited to 'src/PriceListTools/PriceList.cs')
-rw-r--r-- | src/PriceListTools/PriceList.cs | 48 |
1 files changed, 13 insertions, 35 deletions
diff --git a/src/PriceListTools/PriceList.cs b/src/PriceListTools/PriceList.cs index bc11a17..65ff3df 100644 --- a/src/PriceListTools/PriceList.cs +++ b/src/PriceListTools/PriceList.cs @@ -1,42 +1,20 @@ using Microsoft.Office.Interop.Excel; -using System.Collections.Generic; -using System.IO; -using System.Linq; namespace RehauSku.PriceListTools { internal class PriceList { - public readonly string Name; - public readonly PriceListSheet OfferSheet; - public List<PriceListSheet> Sheets { get; private set; } - - private const string offerSheetHeader = "КП"; - - public PriceList(Workbook workbook) - { - Name = workbook.Name; - Sheets = new List<PriceListSheet>(); - - foreach (Worksheet worksheet in workbook.Sheets) - { - PriceListSheet priceListSheet = new PriceListSheet(worksheet); - - if (priceListSheet.FillSkuAmount()) - Sheets.Add(priceListSheet); - } - - OfferSheet = Sheets.Where(s => s.Name == offerSheetHeader).FirstOrDefault(); - } - - public static string CreateNewFile() - { - string fileExtension = Path.GetExtension(RegistryUtil.PriceListPath); - string path = Path.GetTempFileName() + fileExtension; - - File.Copy(RegistryUtil.PriceListPath, path); - return path; - } + protected const string amountHeader = "Кол-во"; + protected const string skuHeader = "Актуальный материал"; + protected const string groupHeader = "Программа"; + protected const string nameHeader = "Наименование"; + + public Range amountCell { get; protected set; } + public Range skuCell { get; protected set; } + public Range groupCell { get; protected set; } + public Range nameCell { get; protected set; } + + public Worksheet Sheet { get; protected set; } + public string Name { get; protected set; } } -} - +}
\ No newline at end of file |