Remove Response Order setting
This commit is contained in:
parent
8155dcce37
commit
10e6a108f9
@ -7,15 +7,6 @@ using System.Runtime.Caching;
|
||||
|
||||
namespace RehauSku
|
||||
{
|
||||
enum ResponseOrder
|
||||
{
|
||||
Default,
|
||||
Relevance,
|
||||
Name,
|
||||
Price,
|
||||
Series
|
||||
}
|
||||
|
||||
class AddIn : IExcelAddIn
|
||||
{
|
||||
public static HttpClient httpClient;
|
||||
|
@ -56,9 +56,7 @@ namespace RehauSku
|
||||
[ExcelFunction(Description = "Получение корректного артикула из строки")]
|
||||
public static object GETRAUSKU([ExcelArgument(Name = "\"Строка\"", Description = "строка, содержащая актикул")] string line)
|
||||
{
|
||||
RauSku rausku;
|
||||
|
||||
if (RauSku.TryParse(line, out rausku))
|
||||
if (RauSku.TryParse(line, out RauSku rausku))
|
||||
{
|
||||
return rausku.ToString();
|
||||
}
|
||||
|
@ -9,14 +9,12 @@ namespace RehauSku
|
||||
static class RegistryUtil
|
||||
{
|
||||
private static string priceListPath;
|
||||
private static int? storeResponseOrder;
|
||||
private static RegistryKey RootKey { get; set; }
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
RootKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\REHAU\SkuAssist");
|
||||
priceListPath = RootKey.GetValue("PriceListPath") as string;
|
||||
storeResponseOrder = RootKey.GetValue("StoreResponseOrder") as int?;
|
||||
}
|
||||
|
||||
public static void Uninitialize()
|
||||
@ -71,23 +69,5 @@ namespace RehauSku
|
||||
{
|
||||
return Path.GetFileName(priceListPath);
|
||||
}
|
||||
|
||||
public static ResponseOrder StoreResponseOrder
|
||||
{
|
||||
get
|
||||
{
|
||||
if (storeResponseOrder == null)
|
||||
{
|
||||
RootKey.SetValue("StoreResponseOrder", (int)ResponseOrder.Default);
|
||||
storeResponseOrder = (int)ResponseOrder.Default;
|
||||
return (ResponseOrder)storeResponseOrder.Value;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return (ResponseOrder)storeResponseOrder.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,25 +27,7 @@ namespace RehauSku.Assistant
|
||||
|
||||
baseUri.Path = "/catalogsearch/result/index/";
|
||||
string cleanedRequest = request.CleanRequest();
|
||||
|
||||
switch (RegistryUtil.StoreResponseOrder)
|
||||
{
|
||||
case ResponseOrder.Relevance:
|
||||
baseUri.Query = "dir=asc&order=relevance&q=" + cleanedRequest;
|
||||
break;
|
||||
case ResponseOrder.Name:
|
||||
baseUri.Query = "dir=asc&order=name&q=" + cleanedRequest;
|
||||
break;
|
||||
case ResponseOrder.Price:
|
||||
baseUri.Query = "dir=asc&order=price&q=" + cleanedRequest;
|
||||
break;
|
||||
case ResponseOrder.Series:
|
||||
baseUri.Query = "dir=asc&order=sch_product_series&q=" + cleanedRequest;
|
||||
break;
|
||||
default:
|
||||
baseUri.Query = "q=" + cleanedRequest;
|
||||
break;
|
||||
}
|
||||
baseUri.Query = "q=" + cleanedRequest;
|
||||
|
||||
return baseUri.Uri;
|
||||
}
|
||||
|
@ -56,9 +56,7 @@ namespace RehauSku.PriceListTools
|
||||
{
|
||||
object current = cells[row, column];
|
||||
|
||||
RauSku rauSku;
|
||||
|
||||
if (RauSku.TryParse(current.ToString(), out rauSku))
|
||||
if (RauSku.TryParse(current.ToString(), out RauSku rauSku))
|
||||
{
|
||||
sku = rauSku.ToString();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user