public async Task DeleteItem(createCuttingItemDto input) { var item = _cuttingitemRepository.Get(input.Id); if (item == null) { throw new UserFriendlyException("Could not found the Item, maybe it's deleted."); } await _cuttingitemRepository.DeleteAsync(item); }
public async Task UpdateItem(createCuttingItemDto input) { var @Item = input.MapTo <CuttingItem>(); var cutItem = _cuttingitemRepository.Get(input.Id); cutItem.Date = input.Date; cutItem.LayerNo = input.LayerNo; cutItem.CutNo = input.CutNo; cutItem.Color = input.Color; cutItem.Size = input.Size; cutItem.NoOfItem = input.NoOfItem; cutItem.NoOfPlys = input.NoOfPlys; cutItem.PoNo = input.PoNo; await _cuttingitemRepository.UpdateAsync(cutItem); }