public IResult Delete(Guid debitId) { var debit = GetById(debitId).Data; var fixture = fixtureService.GetById(debit.FixtureId).Data; if (fixture.FixturePositionId != (short)FixturePositions.Position.Debit) { throw new LogicException(Messages.DebitFixturePosIsNotDebit); } debit.IsReturn = true; debit.DateReturn = DateTime.Now; debit.UpdatedAt = DateTime.Now; debitDal.Update(debit); fixtureService.UpdatePosition(debit.FixtureId, FixturePositions.Position.Available); return(new SuccessResult(Messages.DebitDeleted)); }
public IResult Update(Debit debit) { _debitDal.Update(debit); return(new SuccessResult(Messages.Updated)); }