Exemplo n.º 1
0
 public IResult SetLotPackagingReceived(ISetLotPackagingReceivedParameters parameters)
 {
     try
     {
         return(_lotServiceProvider.SetLotPackagingReceived(parameters));
     }
     catch (Exception ex)
     {
         _exceptionLogger.LogException(ex);
         throw;
     }
 }
Exemplo n.º 2
0
        public IResult SetLotPackagingReceived(ISetLotPackagingReceivedParameters parameters)
        {
            var parsedParameters = parameters.ToParsedParameters();

            if (!parsedParameters.Success)
            {
                return(parsedParameters);
            }

            var result = new SetLotPackagingReceivedCommand(_lotUnitOfWork).Execute(parsedParameters.ResultingObject);

            if (!result.Success)
            {
                return(result);
            }

            _lotUnitOfWork.Commit();

            return(SyncParameters.Using(new SuccessResult(), new SynchronizeLotParameters
            {
                LotKey = parsedParameters.ResultingObject.LotKey,
                OverrideOldContextLotAsCompleted = false
            }));
        }
Exemplo n.º 3
0
        internal static IResult <SetLotPackagingReceivedParameters> ToParsedParameters(this ISetLotPackagingReceivedParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            var lotKeyResult = KeyParserHelper.ParseResult <ILotKey>(parameters.LotKey);

            if (!lotKeyResult.Success)
            {
                return(lotKeyResult.ConvertTo <SetLotPackagingReceivedParameters>());
            }

            var packagingKeyResult = KeyParserHelper.ParseResult <IPackagingProductKey>(parameters.ReceivedPackagingProductKey);

            if (!packagingKeyResult.Success)
            {
                return(packagingKeyResult.ConvertTo <SetLotPackagingReceivedParameters>());
            }

            return(new SuccessResult <SetLotPackagingReceivedParameters>(new SetLotPackagingReceivedParameters
            {
                LotKey = new LotKey(lotKeyResult.ResultingObject),
                PackagingProductKey = new PackagingProductKey(packagingKeyResult.ResultingObject)
            }));
        }