DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/WitsInfoService.cs

36 lines
1.1 KiB
C#
Raw Normal View History

2022-04-08 13:10:06 +05:00
using AsbWitsInfo;
using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services
{
2022-04-08 13:10:06 +05:00
public class WitsInfoService
{
private readonly InfoService witsInfoService;
2022-04-11 18:00:34 +05:00
public WitsInfoService(IEnumerable<ItemInfo>? customItems = null, IEnumerable<RecordInfo>? customRecords = null)
2022-04-08 13:10:06 +05:00
{
witsInfoService = new InfoService(customItems, customRecords);
}
public object GetItems(int idRecord = -1)
{
object items;
2022-04-11 18:00:34 +05:00
if (idRecord > 0)
2022-04-08 13:10:06 +05:00
items = witsInfoService.ItemInfoStore.Where(i => i.RecordId == idRecord);
else
items = witsInfoService.ItemInfoStore.Where(i => true);
return items;
}
public object GetRecords(int idRecord = -1)
{
object items;
if (idRecord > 0)
items = witsInfoService.RecordInfoStore.Where(i => i.RecordId == idRecord);
else
items = witsInfoService.RecordInfoStore.Where(i => true);
return items;
}
}
}