namespace Yw.BLL { /// /// 单位类型 /// public partial class SysUnitType { private readonly Yw.CAL.ISysUnitType _cal = CALCreateHelper.CreateCAL(); #region Query  /// /// /// public virtual async Task> GetAll() { var dtoList = await _cal.GetAll(); return Dto2Vmos(dtoList); } /// /// /// public virtual async Task GetByID(long ID) { var dto = await _cal.GetByID(ID); return Dto2Vmo(dto); } /// /// /// public virtual async Task> GetByIds(List Ids) { if (Ids == null || Ids.Count < 1) { return default; } var dtoList = await _cal.GetByIds(Ids); return Dto2Vmos(dtoList); } #endregion #region Insert /// /// 插入一条 /// public virtual async Task Insert(SysUnitTypeVmo 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 #region Update /// /// 更新 /// public virtual async Task Update(SysUnitTypeVmo 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; } /// /// /// public virtual async Task UpdateCode(long ID, string Code) { var bol = await _cal.UpdateCode(ID, Code); return bol; } /// /// /// public virtual async Task UpdateSortCode(long ID, int SortCode) { var bol = await _cal.UpdateSortCode(ID, SortCode); return bol; } /// /// /// public virtual async Task UpdateSorter(List Sorters) { var dtoList = Sorters.ToDtoList(); var bol = await _cal.UpdateSorter(dtoList); return bol; } #endregion #region Delete  /// /// /// public virtual async Task DeleteByID(long ID) { return await _cal.DeleteByID(ID); } #endregion } }