2024-07-04 11:02:45 +05:00
|
|
|
using AsbWitsInfo;
|
2022-04-08 13:10:06 +05:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
namespace AsbCloudInfrastructure.Services;
|
|
|
|
|
2023-04-18 16:22:53 +05:00
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
public class WitsInfoService
|
|
|
|
{
|
|
|
|
private readonly InfoService witsInfoService;
|
|
|
|
public WitsInfoService(IEnumerable<ItemInfo>? customItems = null, IEnumerable<RecordInfo>? customRecords = null)
|
2022-04-08 13:10:06 +05:00
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
witsInfoService = new InfoService(customItems, customRecords);
|
|
|
|
}
|
2022-04-08 13:10:06 +05:00
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
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;
|
|
|
|
}
|
2022-04-08 13:10:06 +05:00
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
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;
|
2022-04-08 13:10:06 +05:00
|
|
|
}
|
|
|
|
}
|