using Yw.BLL;
namespace HStation.BLL
{
///
///
///
public partial class XhsScheme
{
private readonly HStation.CAL.IXhsScheme _cal = CALCreateHelper.CreateCAL();
#region Query
///
/// 获取所有
///
public async virtual Task> GetAll()
{
var dtoList = await _cal.GetAll();
return Dto2Vmos(dtoList);
}
///
/// 通过 ID 获取
///
public async virtual Task GetByID(long ID)
{
var dto = await _cal.GetByID(ID);
return Dto2Vmo(dto);
}
///
/// 通过 Ids 获取
///
public async virtual Task> GetByIds(List Ids)
{
var dtoList = await _cal.GetByIds(Ids);
return Dto2Vmos(dtoList);
}
///
/// 通过 ProjectID 获取
///
public async virtual Task> GetByProjectID(long ProjectID)
{
var dtoList = await _cal.GetByProjectID(ProjectID);
return Dto2Vmos(dtoList);
}
///
/// 通过 SiteID 获取
///
public async virtual Task> GetBySiteID(long SiteID)
{
var dtoList = await _cal.GetBySiteID(SiteID);
return Dto2Vmos(dtoList);
}
///
/// 通过 SiteIds 获取
///
public async virtual Task> GetBySiteIds(List SiteIds)
{
var dtoList = await _cal.GetBySiteIds(SiteIds);
return Dto2Vmos(dtoList);
}
#endregion
#region Insert
///
/// 插入一条
///
public async virtual Task Insert(XhsSchemeVmo vmo)
{
var dto = Vmo2AddDto(vmo);
var id = await _cal.Insert(dto);
return id;
}
///
/// 插入多条
///
public async virtual Task Inserts(List vmoList)
{
var dtoList = Vmo2AddDtos(vmoList);
var bol = await _cal.Inserts(dtoList);
return bol;
}
#endregion
#region Update
///
/// 更新
///
public async virtual Task Update(XhsSchemeVmo vmo)
{
var dto = Vmo2UpdateDto(vmo);
var bol = await _cal.Update(dto);
return bol;
}
///
/// 批量更新
///
public async virtual Task Updates(List vmoList)
{
var dtoList = Vmo2UpdateDtos(vmoList);
var bol = await _cal.Updates(dtoList);
return bol;
}
///
/// 更新排序码
///
public async virtual Task UpdateSortCode(long ID, int SortCode)
{
var bol = await _cal.UpdateSortCode(ID, SortCode);
return bol;
}
///
/// 批量更新编码
///
public async virtual Task UpdateSorter(List Sorters)
{
var dtoList = Sorters.ToDtoList();
var bol = await _cal.UpdateSorter(dtoList);
return bol;
}
///
/// 更新 Paras
///
public async virtual Task UpdateParas(long ID, Dictionary Paras)
{
return await _cal.UpdateParas(ID, Paras);
}
///
/// 更新 Flags
///
public async virtual Task UpdateFlags(long ID, List Flags)
{
return await _cal.UpdateFlags(ID, Flags);
}
///
/// 更新 UseStatus
///
public async virtual Task UpdateUseStatus(long ID, int UseStatus)
{
return await _cal.UpdateUseStatus(ID, UseStatus);
}
#endregion
#region Exist
///
/// 通过 ProjectID 判断是否存在
///
public async virtual Task IsExistByProjectID(long ProjectID)
{
return await _cal.IsExistByProjectID(ProjectID);
}
///
/// 通过 SiteID 判断是否存在
///
public async virtual Task IsExistBySiteID(long SiteID)
{
return await _cal.IsExistBySiteID(SiteID);
}
#endregion
#region Delete
///
/// 全部删除
///
public async virtual Task DeleteAll()
{
var bol = await _cal.DeleteAll();
return bol;
}
///
/// 通过 ID 删除
///
public async virtual Task DeleteByID(long ID)
{
var bol = await _cal.DeleteByID(ID);
return bol;
}
///
/// 通过 Ids 删除
///
public async virtual Task DeleteByIds(List Ids)
{
var bol = await _cal.DeleteByIds(Ids);
return bol;
}
#endregion
}
}