public IResult Update(Yacth yacth) { if (yacth.DailyPrice > 0) { _yacthDal.Update(yacth); return(new SuccessResult(Messages.SuccessYacthUpdated)); } _yacthDal.Update(yacth); return(new SuccessResult(Messages.DailyPriceInvalid)); }
public IDataResult <Yacth> GetYacthById(int id) { Yacth yacth = _yacthDal.Get(c => c.Id == id); if (yacth == null) { return(new ErrorDataResult <Yacth>(Messages.GetErrorYacthMessage)); } return(new SuccessDataResult <Yacth>(yacth, Messages.YacthGet)); }
public IResult AddTransactionalTest(Yacth yacth) { Add(yacth); if (yacth.DailyPrice < 10) { throw new Exception(""); } Add(yacth); return(null); }
public IActionResult Delete(Yacth yacth) { var result = _yacthService.Delete(yacth); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public IDataResult <Yacth> Add(Yacth yacth) { _yacthDal.Add(yacth); return(new SuccessDataResult <Yacth>(yacth, Messages.YacthAdded)); }
public IResult Delete(Yacth yacth) { _yacthDal.Delete(yacth); return(new SuccessResult(Messages.SuccessYacthDelete)); }