This commit is contained in:
@@ -77,7 +77,19 @@ namespace AyaNova.Biz
|
|||||||
//
|
//
|
||||||
internal async Task<List<NameIdActiveChargeCostItem>> GetNameIdActiveChargeCostItemsAsync()
|
internal async Task<List<NameIdActiveChargeCostItem>> GetNameIdActiveChargeCostItemsAsync()
|
||||||
{
|
{
|
||||||
return await ct.Part.AsNoTracking().Select(x => new NameIdActiveChargeCostItem { Name = x.Name, Id = x.Id, Active = x.Active, Cost = x.Cost, Charge = x.Retail }).OrderBy(x => x.Name).ToListAsync();
|
var pList = await ct.Part.AsNoTracking().Select(x => new NameIdActiveChargeCostItem { Id = x.Id, Active = x.Active, Cost = x.Cost, Charge = x.Retail }).OrderBy(x => x.Name).ToListAsync();
|
||||||
|
|
||||||
|
long[] partIdList = new long[0];
|
||||||
|
var PickList = AyaNova.PickList.PickListFactory.GetAyaPickList(AyaType.Part);
|
||||||
|
var partNames = await AyaNova.PickList.PickListFetcher.GetResponseAsync(PickList, null, null, true, partIdList, null, ct, null, string.Empty);
|
||||||
|
foreach (var item in pList)
|
||||||
|
{
|
||||||
|
item.Name = partNames.Where(z => z.Id == item.Id).First().Name;
|
||||||
|
}
|
||||||
|
//sort in place by name
|
||||||
|
pList.Sort((lhs, rhs) => lhs.Name.CompareTo(rhs.Name));
|
||||||
|
|
||||||
|
return pList;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user