aboutsummaryrefslogtreecommitdiff
path: root/src/AddIn
diff options
context:
space:
mode:
authorSerghei Cebotari <51533848+schebotar@users.noreply.github.com>2022-02-14 11:09:22 +0300
committerGitHub <noreply@github.com>2022-02-14 11:09:22 +0300
commit031ea7f7ef0c690d93bb7e653e59c7dac6964dbb (patch)
tree34bb5c7808434a8dad116a052274c271b92f560c /src/AddIn
parent14aa7249fb6ada16416689f013e1f014727bc83a (diff)
parentf190e27948255303c73a6b457ad1c3af1c88dba9 (diff)
Merge pull request #17 from schebotar/dev
Dev
Diffstat (limited to 'src/AddIn')
-rw-r--r--src/AddIn/EventsUtil.cs6
-rw-r--r--src/AddIn/RegistryUtil.cs6
-rw-r--r--src/AddIn/WorksheetExtensions.cs14
3 files changed, 14 insertions, 12 deletions
diff --git a/src/AddIn/EventsUtil.cs b/src/AddIn/EventsUtil.cs
index 102e12e..c10a69a 100644
--- a/src/AddIn/EventsUtil.cs
+++ b/src/AddIn/EventsUtil.cs
@@ -4,7 +4,7 @@ namespace RehauSku
{
internal static class EventsUtil
{
- private static Application Excel = AddIn.Excel;
+ private static readonly Application Excel = AddIn.Excel;
public static void Initialize()
{
@@ -22,12 +22,12 @@ namespace RehauSku
private static void RefreshConvertButton(object sh)
{
- Interface.RibbonController.RefreshControl("convertPrice");
+ Interface.RibbonController.RefreshControl("convert");
}
private static void RefreshExportButton(object sh, Range target)
{
- Interface.RibbonController.RefreshControl("exportToPrice");
+ Interface.RibbonController.RefreshControl("export");
}
}
}
diff --git a/src/AddIn/RegistryUtil.cs b/src/AddIn/RegistryUtil.cs
index 5fe2eea..a13e941 100644
--- a/src/AddIn/RegistryUtil.cs
+++ b/src/AddIn/RegistryUtil.cs
@@ -63,9 +63,15 @@ namespace RehauSku
{
priceListPath = value;
RootKey.SetValue("PriceListPath", value);
+ RibbonController.RefreshControl("setPriceList");
}
}
+ public static string GetPriceListName()
+ {
+ return Path.GetFileName(priceListPath);
+ }
+
public static ResponseOrder StoreResponseOrder
{
get
diff --git a/src/AddIn/WorksheetExtensions.cs b/src/AddIn/WorksheetExtensions.cs
index cffa55c..7880b66 100644
--- a/src/AddIn/WorksheetExtensions.cs
+++ b/src/AddIn/WorksheetExtensions.cs
@@ -1,15 +1,11 @@
using Microsoft.Office.Interop.Excel;
+using RehauSku.PriceListTools;
using System.Linq;
namespace RehauSku
{
public static class WorksheetExtensions
{
- private static string amountHeader = "Кол-во";
- private static string skuHeader = "Актуальный материал";
- private static string groupHeader = "Программа";
- private static string nameHeader = "Наименование";
-
public static bool IsRehauSource(this Worksheet worksheet)
{
Range amountCell;
@@ -19,10 +15,10 @@ namespace RehauSku
Range[] cells = new[]
{
- amountCell = worksheet.Cells.Find(amountHeader),
- skuCell = worksheet.Cells.Find(skuHeader),
- groupCell = worksheet.Cells.Find(groupHeader),
- nameCell = worksheet.Cells.Find(nameHeader)
+ amountCell = worksheet.Cells.Find(PriceListHeaders.Amount),
+ skuCell = worksheet.Cells.Find(PriceListHeaders.Sku),
+ groupCell = worksheet.Cells.Find(PriceListHeaders.Group),
+ nameCell = worksheet.Cells.Find(PriceListHeaders.Name)
};
return cells.All(x => x != null);