Refactoring
This commit is contained in:
parent
5a641d83d8
commit
b7c65d64e9
@ -17,8 +17,8 @@ namespace RehauSku
|
||||
public class AddIn : IExcelAddIn
|
||||
{
|
||||
public static readonly HttpClient httpClient = new HttpClient();
|
||||
public static ResponseOrder responseOrder;
|
||||
public static string priceListPath;
|
||||
public static ResponseOrder StoreResponse { get; set; }
|
||||
public static string PriceListPath { get; set; }
|
||||
|
||||
public void AutoOpen()
|
||||
{
|
||||
@ -46,8 +46,8 @@ namespace RehauSku
|
||||
.OpenSubKey("REHAU")
|
||||
.OpenSubKey("SkuAssist");
|
||||
|
||||
responseOrder = (ResponseOrder)addInKeys.GetValue("ResponseOrder");
|
||||
priceListPath = (string)addInKeys.GetValue("PriceListPath");
|
||||
StoreResponse = (ResponseOrder)addInKeys.GetValue("ResponseOrder");
|
||||
PriceListPath = (string)addInKeys.GetValue("PriceListPath");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ namespace RehauSku.Assistant
|
||||
baseUri.Path = "/catalogsearch/result/index/";
|
||||
string cleanedRequest = request.CleanRequest();
|
||||
|
||||
switch (AddIn.responseOrder)
|
||||
switch (AddIn.StoreResponse)
|
||||
{
|
||||
case ResponseOrder.Relevance:
|
||||
baseUri.Query = "dir=asc&order=relevance&q=" + cleanedRequest;
|
||||
|
@ -76,7 +76,7 @@ namespace RehauSku.DataExport
|
||||
public void FillPriceList()
|
||||
{
|
||||
string exportFile = _GetExportFullPath();
|
||||
File.Copy(AddIn.priceListPath, exportFile, true);
|
||||
File.Copy(AddIn.PriceListPath, exportFile, true);
|
||||
|
||||
Workbook wb = xlApp.Workbooks.Open(exportFile);
|
||||
Worksheet ws = wb.ActiveSheet;
|
||||
@ -94,7 +94,7 @@ namespace RehauSku.DataExport
|
||||
|
||||
private string _GetExportFullPath()
|
||||
{
|
||||
string fileExtension = Path.GetExtension(AddIn.priceListPath);
|
||||
string fileExtension = Path.GetExtension(AddIn.PriceListPath);
|
||||
|
||||
return Path.GetTempFileName() + fileExtension;
|
||||
}
|
||||
|
@ -34,7 +34,10 @@ namespace RehauSku.Ribbon
|
||||
{
|
||||
if (!dw.IsRangeValid())
|
||||
{
|
||||
MessageBox.Show("Выделен неверный диапазон!", "Неверный диапазон", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
MessageBox.Show("Выделен неверный диапазон!",
|
||||
"Неверный диапазон",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user