public ActionResult <Location> Get(int id) { Location location = _dao.Get(id); if (location != null) { return(Ok(location)); } else { return(NotFound("Location does not exist")); } }
public ActionResult <Location> Get(int id) { Location location = _dao.Get(id); if (location != null) { return(Ok("Found it, but I'm not telling")); } else { return(NotFound()); } }
public IDataResult <ReplenishmentDetailsDto> GetReplenishmentDetailsDtoById(int replenishmentId) { var replenishment = _replenishmentDao.Get(r => r.Id == replenishmentId); var prodToReplenish = _productDao.Get(p => p.Id == replenishment.ProductToReplenishId); var replenishmentLocation = _locationDao.Get(l => l.Id == replenishment.LocationId); var replenishmentDetailsDto = new ReplenishmentDetailsDto { Id = replenishment.Id, Reference = replenishment.Reference, ProductToReplenishId = prodToReplenish.Id, ProductToReplenishName = prodToReplenish.Name, LocationId = replenishmentLocation.Id, LocationName = replenishmentLocation.Name, OnHandQuantity = replenishment.OnHandQuantity, OrderQuantity = replenishment.OrderQuantity, Status = replenishment.Status }; return(new SuccessDataResult <ReplenishmentDetailsDto>(replenishmentDetailsDto)); }
public IDataResult <TransferDetailsDto> GetTransferDetailsDtoById(int transferId) { var transfer = _transferDao.Get(t => t.Id == transferId); var receiveFrom = _locationDao.Get(l => l.Id == transfer.ReceiveFromId); var destinationLoc = _locationDao.Get(l => l.Id == transfer.DestinationLocationId); var transferDetailsDto = new TransferDetailsDto { Id = transfer.Id, Reference = transfer.Reference, OperationTypeId = transfer.OperationTypeId, ReceiveFromId = receiveFrom.Id, ReceiveFromName = receiveFrom.Name, ScheduledDate = transfer.ScheduledDate, EffectiveDate = transfer.EffectiveDate, ResponsibleId = transfer.ResponsibleId, DestinationLocationId = destinationLoc.Id, DestinationLocationName = destinationLoc.Name, TransferProductsId = transfer.TransferProductsId, }; return(new SuccessDataResult <TransferDetailsDto>(transferDetailsDto)); }
public IDataResult <Location> GetById(int id) { return(new SuccessDataResult <Location>(_locationDao.Get(l => l.Id == id))); }