using AutoMapper;
using HStation.Vmo;
using Yw.BLL;
namespace HStation.BLL
{
///
///
///
public partial class AssetsPackageMain
{
private readonly HStation.CAL.IAssetsPackageMain _cal = CALCreateHelper.CreateCAL();
#region Query
///
/// 获取所有
///
public virtual async Task> GetAll()
{
var dtoList = await _cal.GetAll();
return Dto2Vmos(dtoList);
}
///
/// 通过 ID 获取
///
public virtual async Task GetByID(long ID)
{
var dto = await _cal.GetByID(ID);
return Dto2Vmo(dto);
}
///
/// 通过 Ids 获取
///
public virtual async Task> GetByIds(List Ids)
{
var dtoList = await _cal.GetByIds(Ids);
return Dto2Vmos(dtoList);
}
///
/// 通过系列ID查找
///
///
///
public async Task> GetBySeriesID(long ID)
{
var Dto = await _cal.GetBySeriesID(ID);
var dtoList = Dto2Vmos(Dto);
return dtoList;
}
#endregion Query
#region Insert
///
/// 插入一条
///
public virtual async Task Insert(AssetsPackageMainVmo vmo)
{
var dto = Vmo2AddDto(vmo);
var id = await _cal.Insert(dto);
return id;
}
///
/// 插入多条
///
public virtual async Task Inserts(List vmoList)
{
var dtoList = Vmo2AddDtos(vmoList);
var bol = await _cal.Inserts(dtoList);
return bol;
}
#endregion Insert
#region Update
///
/// 更新
///
public virtual async Task Update(AssetsPackageMainVmo vmo)
{
var dto = Vmo2UpdateDto(vmo);
var bol = await _cal.Update(dto);
return bol;
}
///
/// 批量更新
///
public virtual async Task Updates(List vmoList)
{
var dtoList = Vmo2UpdateDtos(vmoList);
var bol = await _cal.Updates(dtoList);
return bol;
}
#endregion Update
#region Delete
///
/// 全部删除
///
public virtual async Task DeleteAll()
{
var bol = await _cal.DeleteAll();
return bol;
}
///
/// 通过 ID 删除
///
public virtual async Task DeleteByID(long ID)
{
var bol = await _cal.DeleteByID(ID);
return bol;
}
///
/// 通过 Ids 删除
///
public virtual async Task DeleteByIds(List Ids)
{
var bol = await _cal.DeleteByIds(Ids);
return bol;
}
#endregion Delete
}
}