Search for range vaules in Product search function

This commit is contained in:
Serghei Cebotari 2024-11-06 22:46:44 +03:00
parent 06e47d3135
commit a73b2441b3

View File

@ -8,8 +8,21 @@ public static class RhSolutionsFunctions
RhSolutionsAddIn.ServiceProvider.GetRequiredService<ICurrencyClient>(); RhSolutionsAddIn.ServiceProvider.GetRequiredService<ICurrencyClient>();
[ExcelFunction(Name = "РЕХАУ")] [ExcelFunction(Name = "РЕХАУ")]
public static object ProductSearch(string query) public static object ProductSearch(object[,] values)
{ {
List<string> strings = new();
int rows = values.GetLength(0);
int columns = values.GetLength(1);
for (int row = 0; row < rows; row++)
{
for (int column = 0; column < columns; column++)
{
object value = values[row, column];
strings.Add(value.ToString());
}
}
string query = string.Join(" ", strings.ToArray());
var functionName = nameof(ProductSearch); var functionName = nameof(ProductSearch);
var parameters = new object[] { query }; var parameters = new object[] { query };
if (ExcelAsyncUtil.RunTask(functionName, parameters, async () => if (ExcelAsyncUtil.RunTask(functionName, parameters, async () =>