Production approval - fertigung auftrag - autocomplete
This commit is contained in:
@@ -7,5 +7,7 @@
|
||||
OrdersFoundModel FindOrders(string search);
|
||||
|
||||
OrderPositions FindPositions(string id);
|
||||
|
||||
ProductionOrders FindProductionOrders(string productionNr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
<Compile Include="Models\OrderIdentity.cs" />
|
||||
<Compile Include="Models\PalletPosition.cs" />
|
||||
<Compile Include="Models\ProductionApproval.cs" />
|
||||
<Compile Include="Models\ProductionOrders.cs" />
|
||||
<Compile Include="Models\RoleModel.cs" />
|
||||
<Compile Include="Models\UserRole.cs" />
|
||||
<Compile Include="Models\UserPermissions.cs" />
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace LaaProductionWeb.Services.Models
|
||||
{
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ProductionOrders : IEnumerable<int>
|
||||
{
|
||||
private readonly IEnumerable<int> productionOrders;
|
||||
|
||||
public ProductionOrders(IEnumerable<int> productionOrders)
|
||||
=> this.productionOrders = productionOrders;
|
||||
|
||||
public IEnumerator<int> GetEnumerator()
|
||||
=> this.productionOrders.GetEnumerator();
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
=> this.GetEnumerator();
|
||||
}
|
||||
}
|
||||
@@ -53,5 +53,20 @@
|
||||
|
||||
return new OrderPositions(positionsFound);
|
||||
}
|
||||
|
||||
public ProductionOrders FindProductionOrders(string productionNr)
|
||||
{
|
||||
var ordersFound = this.dbContext.ExecuteReader($@"
|
||||
SELECT DISTINCT
|
||||
[AlleAuftragPositionen].[FertigungsauftragNr] -- 1
|
||||
FROM [AlleAuftragPositionen]
|
||||
WHERE [AlleAuftragPositionen].[Versand_Ist_datum] IS NOT NULL
|
||||
AND [AlleAuftragPositionen].[AuftragNr] LIKE @{nameof(productionNr)}
|
||||
ORDER BY [AlleAuftragPositionen].[FertigungsauftragNr]",
|
||||
parameters => parameters.Add(nameof(productionNr), $"{productionNr}%"),
|
||||
reader => reader.GetValue<int>());
|
||||
|
||||
return new ProductionOrders(ordersFound);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user