public IResult <IQueryable <IPackScheduleSummaryReturn> > GetPackSchedules() { var packScheduleSummaryReturns = _productionUnitOfWork.PackScheduleRepository.All() .SplitSelect(PackScheduleProjectors.SplitSelectSummary()); return(new SuccessResult <IQueryable <IPackScheduleSummaryReturn> >(packScheduleSummaryReturns)); }
public IResult <IPackScheduleDetailReturn> GetPackSchedule(string packScheduleKey) { if (packScheduleKey == null) { throw new ArgumentNullException("packScheduleKey"); } var packScheduleKeyResult = KeyParserHelper.ParseResult <IPackScheduleKey>(packScheduleKey); if (!packScheduleKeyResult.Success) { return(packScheduleKeyResult.ConvertTo <IPackScheduleDetailReturn>()); } var key = new PackScheduleKey(packScheduleKeyResult.ResultingObject); var packSchedule = _productionUnitOfWork.PackScheduleRepository .FilterByKey(key) .SplitSelect(PackScheduleProjectors.SplitSelectDetail()) .FirstOrDefault(); if (packSchedule == null) { return(new InvalidResult <IPackScheduleDetailReturn>(null, string.Format(UserMessages.PackScheduleNotFound, key))); } return(new SuccessResult <IPackScheduleDetailReturn>(packSchedule)); }
internal IResult <IProductionPacketReturn> Execute(IPackScheduleKey packScheduleKey, DateTime currentDate) { var parsedPackScheduleKey = new PackScheduleKey(packScheduleKey); var productionPacket = _productionUnitOfWork.PackScheduleRepository .Filter(parsedPackScheduleKey.FindByPredicate) .SplitSelect(PackScheduleProjectors.SplitSelectProductionPacket(_productionUnitOfWork, currentDate.Date)) .ToList(); if (productionPacket.Count != 1) { return(new InvalidResult <IProductionPacketReturn>(null, string.Format(UserMessages.PackScheduleNotFound, parsedPackScheduleKey))); } return(Process(productionPacket.Single())); }
public IResult <IPackSchedulePickSheetReturn> GetPackSchedulePickSheet(string packScheduleKey) { var packScheduleKeyResult = KeyParserHelper.ParseResult <IPackScheduleKey>(packScheduleKey); if (!packScheduleKeyResult.Success) { return(packScheduleKeyResult.ConvertTo <IPackSchedulePickSheetReturn>()); } var pickSheet = _productionUnitOfWork.PackScheduleRepository .Filter(new PackScheduleKey(packScheduleKeyResult.ResultingObject).FindByPredicate) .SplitSelect(PackScheduleProjectors.SplitSelectPickSheet(_productionUnitOfWork, _timeStamper.CurrentTimeStamp.Date)) .FirstOrDefault(); if (pickSheet == null) { return(new InvalidResult <IPackSchedulePickSheetReturn>(null, string.Format(UserMessages.PackScheduleNotFound, packScheduleKey))); } return(new SuccessResult <IPackSchedulePickSheetReturn>(pickSheet)); }