| | |
| | | using Yw.Dto; |
| | | using AutoMapper; |
| | | using System.Collections.Generic; |
| | | using Yw; |
| | | using Yw.Dto; |
| | | |
| | | namespace HStation.BLL |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class PumpSeries : CAL.IPumpSeries |
| | | public class PumpSeries |
| | | { |
| | | private readonly HStation.CAL.IPumpSeries _cal = CALCreateHelper.CreateCAL<HStation.CAL.IPumpSeries>(); |
| | | |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<List<PumpSeriesDto>> GetAll() |
| | | public async Task<List<Vmo.PumpSeries>> GetAll() |
| | | { |
| | | return await _cal.GetAll(); |
| | | var DtoList = await _cal.GetAll(); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.PumpSeriesDto, Vmo.PumpSeries>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Dto.Assets.PumpSeriesDto>, List<Vmo.PumpSeries>>(DtoList); |
| | | return vmoList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<PumpSeriesDto> GetByID(long ID) |
| | | public async Task<Vmo.PumpSeries> GetByID(long ID) |
| | | { |
| | | return await _cal.GetByID(ID); |
| | | var DtoList = await _cal.GetByID(ID); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.PumpSeriesDto, Vmo.PumpSeries>() |
| | | ).CreateMapper(); |
| | | var vmo = mapper.Map<Dto.Assets.PumpSeriesDto, Vmo.PumpSeries>(DtoList); |
| | | return vmo; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public async Task<List<PumpSeriesDto>> GetByIds(List<long> Ids) |
| | | { |
| | | return await _cal.GetByIds(Ids); |
| | | var DtoList = await _cal.GetByIds(Ids); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.PumpSeriesDto, Vmo.PumpSeries>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Dto.Assets.PumpSeriesDto>, List<Vmo.PumpSeries>>(DtoList); |
| | | return DtoList; |
| | | } |
| | | |
| | | #endregion Query |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<long> Insert(AddPumpSeriesDto model) |
| | | public async Task<long> Insert(Vmo.PumpSeries model) |
| | | { |
| | | return await _cal.Insert(model); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.AddPumpSeriesDto>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<Vmo.PumpSeries, AddPumpSeriesDto>(model); |
| | | return await _cal.Insert(vmoList); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Inserts(List<AddPumpSeriesDto> list) |
| | | public async Task<bool> Inserts(List<Vmo.PumpSeries> list) |
| | | { |
| | | return await _cal.Inserts(list); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.AddPumpSeriesDto>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Vmo.PumpSeries>, List<AddPumpSeriesDto>>(list); |
| | | return await _cal.Inserts(vmoList); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> BulkInserts(List<AddPumpSeriesDto> list) |
| | | public async Task<bool> BulkInserts(List<Vmo.PumpSeries> list) |
| | | { |
| | | return await _cal.BulkInserts(list); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.AddPumpSeriesDto>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Vmo.PumpSeries>, List<AddPumpSeriesDto>>(list); |
| | | |
| | | return await _cal.BulkInserts(vmoList); |
| | | } |
| | | |
| | | #endregion Insert |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Update(UpdatePumpSeriesDto model) |
| | | public async Task<bool> Update(Vmo.PumpSeries model) |
| | | { |
| | | return await _cal.Update(model); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.UpdatePumpSeriesDto>() |
| | | ).CreateMapper(); |
| | | var vmo = mapper.Map<Vmo.PumpSeries, UpdatePumpSeriesDto>(model); |
| | | return await _cal.Update(vmo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Updates(List<UpdatePumpSeriesDto> list) |
| | | public async Task<bool> Updates(List<Vmo.PumpSeries> list) |
| | | { |
| | | return await _cal.Updates(list); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.UpdatePumpSeriesDto>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Vmo.PumpSeries>, List<UpdatePumpSeriesDto>>(list); |
| | | |
| | | return await _cal.Updates(vmoList); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> BulkUpdates(List<UpdatePumpSeriesDto> list) |
| | | public async Task<bool> BulkUpdates(List<Vmo.PumpSeries> list) |
| | | { |
| | | return await _cal.BulkUpdates(list); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.UpdatePumpSeriesDto>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Vmo.PumpSeries>, List<UpdatePumpSeriesDto>>(list); |
| | | |
| | | return await _cal.BulkUpdates(vmoList); |
| | | } |
| | | |
| | | /// <summary> |