| | |
| | | using HStation.CAL; |
| | | using Yw.BLL; |
| | | |
| | | namespace HStation.BLL |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class XhsProject : IXhsProject |
| | | public partial class XhsProject |
| | | { |
| | | private readonly HStation.CAL.IXhsProject _cal = CALCreateHelper.CreateCAL<HStation.CAL.IXhsProject>(); |
| | | |
| | | public Task<bool> BulkInserts(List<AddXhsProjectInput> list) |
| | | #region Query |
| | | |
| | | /// <summary> |
| | | /// 获取所有 |
| | | /// </summary> |
| | | public virtual async Task<List<XhsProjectVmo>> GetAll() |
| | | { |
| | | return _cal.BulkInserts(list); |
| | | var dtoList = await _cal.GetAll(); |
| | | return Dto2Vmos(dtoList); |
| | | } |
| | | |
| | | public Task<bool> BulkUpdates(List<UpdateXhsProjectInput> list) |
| | | /// <summary> |
| | | /// 通过 ID 获取 |
| | | /// </summary> |
| | | public virtual async Task<XhsProjectVmo> GetByID(long ID) |
| | | { |
| | | return _cal.BulkUpdates(list); |
| | | var dto = await _cal.GetByID(ID); |
| | | return Dto2Vmo(dto); |
| | | } |
| | | |
| | | public Task<bool> DeleteAll() |
| | | /// <summary> |
| | | /// 通过 Ids 获取 |
| | | /// </summary> |
| | | public virtual async Task<List<XhsProjectVmo>> GetByIds(List<long> Ids) |
| | | { |
| | | return _cal.DeleteAll(); |
| | | var dtoList = await _cal.GetByIds(Ids); |
| | | return Dto2Vmos(dtoList); |
| | | } |
| | | |
| | | public Task<bool> DeleteByID(long ID) |
| | | /// <summary> |
| | | /// 获取数量 |
| | | /// </summary> |
| | | public virtual async Task<int> GetCount() |
| | | { |
| | | return _cal.DeleteByID(ID); |
| | | var count = await _cal.GetCount(); |
| | | return count; |
| | | } |
| | | |
| | | public Task<bool> DeleteByIds(List<long> Ids) |
| | | #endregion Query |
| | | |
| | | #region Insert |
| | | |
| | | /// <summary> |
| | | /// 插入一条 |
| | | /// </summary> |
| | | public virtual async Task<long> Insert(XhsProjectVmo vmo) |
| | | { |
| | | return _cal.DeleteByIds(Ids); |
| | | var dto = Vmo2AddDto(vmo); |
| | | var id = await _cal.Insert(dto); |
| | | return id; |
| | | } |
| | | |
| | | public Task<bool> Deprecate(long ID) |
| | | /// <summary> |
| | | /// 插入多条 |
| | | /// </summary> |
| | | public virtual async Task<bool> Inserts(List<XhsProjectVmo> vmoList) |
| | | { |
| | | return _cal.Deprecate(ID); |
| | | var dtoList = Vmo2AddDtos(vmoList); |
| | | var bol = await _cal.Inserts(dtoList); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<List<XhsProjectDto>> GetAll() |
| | | #endregion Insert |
| | | |
| | | #region Update |
| | | |
| | | /// <summary> |
| | | /// 更新 |
| | | /// </summary> |
| | | public virtual async Task<bool> Update(XhsProjectVmo vmo) |
| | | { |
| | | return _cal.GetAll(); |
| | | var dto = Vmo2UpdateDto(vmo); |
| | | var bol = await _cal.Update(dto); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<XhsProjectDto> GetByID(long ID) |
| | | /// <summary> |
| | | /// 批量更新 |
| | | /// </summary> |
| | | public virtual async Task<bool> Updates(List<XhsProjectVmo> vmoList) |
| | | { |
| | | return _cal.GetByID(ID); |
| | | var dtoList = Vmo2UpdateDtos(vmoList); |
| | | var bol = await _cal.Updates(dtoList); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<List<XhsProjectDto>> GetByIds(List<long> Ids) |
| | | /// <summary> |
| | | /// 更新排序码 |
| | | /// </summary> |
| | | public virtual async Task<bool> UpdateSortCode(long ID, int SortCode) |
| | | { |
| | | return _cal.GetByIds(Ids); |
| | | var bol = await _cal.UpdateSortCode(ID, SortCode); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<long> Insert(AddXhsProjectInput model) |
| | | /// <summary> |
| | | /// 批量更新排序码 |
| | | /// </summary> |
| | | public virtual async Task<bool> UpdateSorter(List<Yw.Vmo.Sorter> Sorters) |
| | | { |
| | | return _cal.Insert(model); |
| | | var dtoList = Sorters.ToDtoList(); |
| | | var bol = await _cal.UpdateSorter(dtoList); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<bool> Inserts(List<AddXhsProjectInput> list) |
| | | /// <summary> |
| | | /// 更新 Flags |
| | | /// </summary> |
| | | public virtual async Task<bool> UpdateFlags(long ID, List<string> Flags) |
| | | { |
| | | return _cal.Inserts(list); |
| | | return await _cal.UpdateFlags(ID, Flags); |
| | | } |
| | | |
| | | public Task<bool> IsExistTagName(string TagName) |
| | | /// <summary> |
| | | /// 更新 Paras |
| | | /// </summary> |
| | | public virtual async Task<bool> UpdateParas(long ID, Dictionary<string, string> Paras) |
| | | { |
| | | return _cal.IsExistTagName(TagName); |
| | | return await _cal.UpdateParas(ID, Paras); |
| | | } |
| | | |
| | | public Task<bool> IsExistTagNameExceptID(string TagName, long ExceptID) |
| | | /// <summary> |
| | | /// 更新 TagName |
| | | /// </summary> |
| | | public virtual async Task<bool> UpdateTagName(long ID, string TagName) |
| | | { |
| | | return _cal.IsExistTagNameExceptID(TagName, ExceptID); |
| | | return await _cal.UpdateTagName(ID, TagName); |
| | | } |
| | | |
| | | public Task<bool> Publish(long ID) |
| | | #endregion Update |
| | | |
| | | #region Exist |
| | | |
| | | /// <summary> |
| | | /// 判断 TagName 是否存在 |
| | | /// </summary> |
| | | public virtual async Task<bool> IsExistTagName(string TagName) |
| | | { |
| | | return _cal.Publish(ID); |
| | | return await _cal.IsExistTagName(TagName); |
| | | } |
| | | |
| | | public Task<bool> Update(UpdateXhsProjectInput model) |
| | | /// <summary> |
| | | /// 判断TagName是否存在 ExceptID |
| | | /// </summary> |
| | | public virtual async Task<bool> IsExistTagNameExceptID(string TagName, long ExceptID) |
| | | { |
| | | return _cal.Update(model); |
| | | return await _cal.IsExistTagNameExceptID(TagName, ExceptID); |
| | | } |
| | | |
| | | public Task<bool> UpdateFlags(long ID, List<string> Flags) |
| | | #endregion Exist |
| | | |
| | | #region Delete |
| | | |
| | | /// <summary> |
| | | /// 全部删除 |
| | | /// </summary> |
| | | public virtual async Task<bool> DeleteAll() |
| | | { |
| | | return _cal.UpdateFlags(ID, Flags); |
| | | var bol = await _cal.DeleteAll(); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<bool> UpdateParas(long ID, Dictionary<string, string> Paras) |
| | | /// <summary> |
| | | /// 通过 ID 删除 |
| | | /// </summary> |
| | | public virtual async Task<bool> DeleteByID(long ID) |
| | | { |
| | | return _cal.UpdateParas(ID, Paras); |
| | | var bol = await _cal.DeleteByID(ID); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<bool> Updates(List<UpdateXhsProjectInput> list) |
| | | /// <summary> |
| | | /// 通过 Ids 删除 |
| | | /// </summary> |
| | | public virtual async Task<bool> DeleteByIds(List<long> Ids) |
| | | { |
| | | return _cal.Updates(list); |
| | | var bol = await _cal.DeleteByIds(Ids); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<bool> UpdateSortCode(long ID, int SortCode) |
| | | { |
| | | return _cal.UpdateSortCode(ID, SortCode); |
| | | } |
| | | #endregion Delete |
| | | |
| | | public Task<bool> UpdateSorter(List<UpdateSortCodeInput> Sorters) |
| | | { |
| | | return _cal.UpdateSorter(Sorters); |
| | | } |
| | | |
| | | public Task<bool> UpdateTagName(long ID, string TagName) |
| | | { |
| | | return _cal.UpdateTagName(ID, TagName); |
| | | } |
| | | } |
| | | } |