Exemplo n.º 1
0
        public IResult <ILotStatInfoReturn> RemoveLotDefectResolution(IRemoveLotDefectResolutionParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            var parsedParameters = parameters.ToParsedParameters();

            if (!parsedParameters.Success)
            {
                return(parsedParameters.ConvertTo <ILotStatInfoReturn>());
            }

            var result = new RemoveLotDefectResolutionConductor(_lotUnitOfWork).RemoveLotDefectResolution(parsedParameters.ResultingObject, _timeStamper.CurrentTimeStamp);

            if (!result.Success)
            {
                return(result.ConvertTo <ILotStatInfoReturn>());
            }

            _lotUnitOfWork.Commit();

            var synchronizeLotParameters = new SynchronizeLotParameters
            {
                LotKey = parsedParameters.ResultingObject.LotDefectKey,
                OverrideOldContextLotAsCompleted = false
            };

            return(SyncParameters.Using(new SuccessResult <ILotStatInfoReturn>(new LotStatInfoReturn(synchronizeLotParameters)), synchronizeLotParameters));
        }
Exemplo n.º 2
0
 public IResult <ILotStatInfoReturn> RemoveLotDefectResolution(IRemoveLotDefectResolutionParameters parameters)
 {
     try
     {
         return(_lotServiceProvider.RemoveLotDefectResolution(parameters));
     }
     catch (Exception ex)
     {
         _exceptionLogger.LogException(ex);
         return(new FailureResult <ILotStatInfoReturn>(null, ex.Message));
     }
 }
        internal static IResult <RemoveLotDefectResolutionParameters> ToParsedParameters(this IRemoveLotDefectResolutionParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            var lotDefectKey = KeyParserHelper.ParseResult <ILotDefectKey>(parameters.LotDefectKey);

            if (!lotDefectKey.Success)
            {
                return(lotDefectKey.ConvertTo <RemoveLotDefectResolutionParameters>(null));
            }

            return(new SuccessResult <RemoveLotDefectResolutionParameters>(new RemoveLotDefectResolutionParameters
            {
                Parameters = parameters,
                LotDefectKey = new LotDefectKey(lotDefectKey.ResultingObject)
            }));
        }