DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/WitsInfoService.cs
2024-08-19 10:01:07 +05:00

35 lines
980 B
C#

using AsbWitsInfo;
using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services;
public class WitsInfoService
{
private readonly InfoService witsInfoService;
public WitsInfoService(IEnumerable<ItemInfo>? customItems = null, IEnumerable<RecordInfo>? customRecords = null)
{
witsInfoService = new InfoService(customItems, customRecords);
}
public object GetItems(int idRecord = -1)
{
object items;
if (idRecord > 0)
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;
}
}