private async Task <long> SaveOutcome(TransactionDTO entity) { OutcomeDTO outcome = new OutcomeDTO() { Date = entity.Date, CartNumber = entity.CartNumber, CategoryId = entity.CategoryId, DriverId = entity.DriverId, FarmId = entity.FarmId, Quantity = entity.ClientQuantity, KiloDiscount = entity.ClientDiscount, Total = entity.ClientTotal, KiloPrice = entity.ClientPrice, StationId = entity.StationId, TransactionId = entity.Id }; if (_ISEDITMODE)//Edit Mode { var oldOutcome = await GetOutcomtByTransactionId(entity.Id); outcome.Id = oldOutcome.Id; } return(await _outcomeDSL.Save(outcome)); }
public async Task <long> Save(OutcomeDTO entity) { try { return(await _outcomeDAL.Save(_mapper.Map <Outcome>(entity))); } catch (Exception ex) { return(0); } }
public async Task <IActionResult> Save(OutcomeDTO model) => Ok(await _outcomeDSL.Save(model));