RhSolutions-AddIn/Functions.cs

29 lines
869 B
C#
Raw Normal View History

2021-11-11 16:33:40 +03:00
using ExcelDna.Integration;
namespace Rehau.Sku.Assist
{
public class Functions : IExcelAddIn
{
[ExcelFunction(description: "Получение наименования и артикула позиции")]
public static object RAUNAME(string request)
2021-11-11 16:33:40 +03:00
{
SkuAssist.EnsureHttpInitialized();
return ExcelTaskUtil.Run("RAUNAME ASYNC", request, async token =>
{
var document = await SkuAssist.GetDocumentAsync(request);
return SkuAssist.GetResultFromDocument(document);
});
2021-11-11 16:33:40 +03:00
}
public void AutoClose()
{
ExcelIntegration.RegisterUnhandledExceptionHandler(
delegate (object ex) { return string.Format("!!!ERROR: {0}", ex.ToString()); });
}
public void AutoOpen()
{
}
}
}