public async Task <UpdateCommonMaterialDTO> GetAsync() { PagedAndSortedResultRequestDto input = new PagedAndSortedResultRequestDto() { MaxResultCount = 200, SkipCount = 0, Sorting = "id" }; var names = _materialNameService.GetListAsync(input).Result.Items.ToList(); List <UpdateBillMaterialsDTO> billlist = new List <UpdateBillMaterialsDTO>(); UpdateCommonMaterialDTO updatecommonMaterialDTO = new UpdateCommonMaterialDTO(); foreach (var item in names) { UpdateBillMaterialsDTO updateBillMaterialsDTO = new UpdateBillMaterialsDTO(); updateBillMaterialsDTO.MaterialsType = item.MaterialsType; updateBillMaterialsDTO.MaterialsName = item.MaterialsName; updateBillMaterialsDTO.MateriralsPrice = item.UnitPrice; updateBillMaterialsDTO.units = item.units; billlist.Add(updateBillMaterialsDTO); } updatecommonMaterialDTO.BillMaterials = billlist; return(updatecommonMaterialDTO); }
public async Task <CommonMaterialDTO> PostAsync(UpdateCommonMaterialDTO updateCommonMaterialDTO) { var data = await _commonMaterialService.CreateAsync(updateCommonMaterialDTO); return(data); }
public override Task <CommonMaterialDTO> CreateAsync(UpdateCommonMaterialDTO input) { // ObjectMapper.Map<CommonMaterialDTO, CommonMaterial>(input); // var data= _repository.InsertAsync(); var data = base.CreateAsync(input); return(data); }