コード例 #1
0
        public static Expression <Func <Lot, bool> > FilterByProductKey(ILotUnitOfWork lotUnitOfWork, IKey <Product> productKey)
        {
            var productPredicate = productKey.FindByPredicate;
            var product          = LotProjectors.SelectProduct(lotUnitOfWork);

            return(l => productPredicate.Invoke(product.Invoke(l)));
        }
コード例 #2
0
 internal RemoveLotDefectResolutionConductor(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
 internal CalculateAttributeWeightedAveragesCommand(ILotUnitOfWork lotUnifOfWork)
 {
     if (lotUnifOfWork == null)
     {
         throw new ArgumentNullException("lotUnifOfWork");
     }
     _lotUnifOfWork = lotUnifOfWork;
 }
コード例 #4
0
 public GetProductSpecCommand(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #5
0
 internal DeleteLotConductor(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #6
0
 internal SetLotAttributesConductor(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #7
0
 public SetLotWeightedAttributesConductor(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #8
0
 internal RemoveLotCommand(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #9
0
 internal RecordLotHistoryCommand(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #10
0
 internal UpdateChileLotStatusCommand(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #11
0
 internal SetLotPackagingReceivedCommand(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #12
0
 internal CreateInHouseContaminationDefectCommand(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #13
0
 internal CreateLotDefectResolutionCommand(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #14
0
 protected CreateNewLotCommandBase(ILotUnitOfWork lotUnitOfWork)
 {
     if (lotUnitOfWork == null)
     {
         throw new ArgumentNullException("lotUnitOfWork");
     }
     LotUnitOfWork = lotUnitOfWork;
 }
コード例 #15
0
        internal static Expression <Func <Lot, bool> > FilterByProductType(ILotUnitOfWork lotUnitOfWork, ProductTypeEnum productType)
        {
            if (lotUnitOfWork == null)
            {
                throw new ArgumentNullException("lotUnitOfWork");
            }

            var product = LotProjectors.SelectProduct(lotUnitOfWork);

            return(l => product.Invoke(l).ProductType == productType);
        }
コード例 #16
0
        internal static Expression <Func <Lot, bool> > FilterByLotProductionStart(ILotUnitOfWork lotUnitOfWork, DateTime?rangeStart, DateTime?rangeEnd)
        {
            if (lotUnitOfWork == null)
            {
                throw new ArgumentNullException("lotUnitOfWork");
            }

            var results           = LotProjectors.SelectChileLotResults(lotUnitOfWork);
            var byProductionBegin = ProductionResultPredicates.FilterByProductionBegin(rangeStart, rangeEnd);

            return(l => results.Invoke(l).Select(r => byProductionBegin.Invoke(r)).FirstOrDefault() ?? false);
        }
コード例 #17
0
        internal static Expression <Func <Lot, Product> > SelectProduct(ILotUnitOfWork lotUnitOfWork)
        {
            if (lotUnitOfWork == null)
            {
                throw new ArgumentNullException("lotUnitOfWork");
            }

            var chileLot     = SelectChileLot(lotUnitOfWork);
            var additiveLot  = SelectAdditiveLot(lotUnitOfWork);
            var packagingLot = SelectPackagingLot(lotUnitOfWork);

            return(lot => chileLot.Invoke(lot).Select(c => c.ChileProduct.Product).Concat(additiveLot.Invoke(lot).Select(a => a.AdditiveProduct.Product)).Concat(packagingLot.Invoke(lot).Select(p => p.PackagingProduct.Product)).FirstOrDefault());
        }
コード例 #18
0
        internal static Expression <Func <Lot, int?> > SelectAstaCalc(ILotUnitOfWork lotUnitOfWork, DateTime currentDate)
        {
            if (lotUnitOfWork == null)
            {
                throw new ArgumentNullException("lotUnitOfWork");
            }

            var calculateAsta = CalculateAsta(currentDate);
            var results       = lotUnitOfWork.LotProductionResultsRepository.All();
            var lotKeyFilter  = LotPredicates.ConstructLotKeyPredicate <Lot, LotProductionResults>();

            return(Projector <Lot> .To(l => calculateAsta.Invoke
                                       (
                                           l.Attributes.FirstOrDefault(a => a.AttributeShortName == GlobalKeyHelpers.AstaAttributeNameKey.AttributeNameKey_ShortName),
                                           results.Where(lotKeyFilter.Invoke(l)).Select(r => (DateTime?)r.ProductionEnd).FirstOrDefault()
                                       )));
        }
コード例 #19
0
        internal static Expression <Func <InventoryAdjustmentItem, InventoryAdjustmentItemReturn> > Select(ILotUnitOfWork lotUnitOfWork)
        {
            var key = SelectKey();

            var inventoryProduct  = LotProjectors.SelectDerivedProduct();
            var lotKey            = LotProjectors.SelectLotKey <Lot>();
            var warehouseLocation = LocationProjectors.SelectLocation();
            var packagingProduct  = ProductProjectors.SelectPackagingProduct();
            var treatment         = InventoryTreatmentProjectors.SelectInventoryTreatment();

            return(i => new InventoryAdjustmentItemReturn
            {
                InventoryAdjustmentItemKeyReturn = key.Invoke(i),

                AdjustmentQuantity = i.QuantityAdjustment,
                InventoryProduct = inventoryProduct.Invoke(i.Lot),

                LotKeyReturn = lotKey.Invoke(i.Lot),
                Location = warehouseLocation.Invoke(i.Location),
                PackagingProduct = packagingProduct.Invoke(i.PackagingProduct),
                InventoryTreatment = treatment.Invoke(i.Treatment),
                ToteKey = i.ToteKey
            });
        }
コード例 #20
0
        internal static Expression <Func <IEnumerable <AttributeNameAndType> > > SelectActiveAttributeNames(ILotUnitOfWork lotUnitOfWork)
        {
            var attributes = lotUnitOfWork.AttributeNameRepository.Filter(a => a.Active);
            var selector   = Select();

            return(() => attributes.Select(a => selector.Invoke(a)));
        }
コード例 #21
0
 internal LotTraceOutputCommand(ILotUnitOfWork lotUnitOfWork)
 {
     _lotUnitOfWork = lotUnitOfWork;
     _selectOutputs = LotProjectors.SelectLotOutputTrace(lotUnitOfWork);
 }
コード例 #22
0
 internal LotAllowancesCommand(ILotUnitOfWork lotUnitOfWork)
 {
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #23
0
 public CreateNewAdditiveLotCommand(ILotUnitOfWork lotUnitOfWork) : base(lotUnitOfWork)
 {
 }
コード例 #24
0
        internal static Expression <Func <LotProductionResults, ProductionAdditiveInputs> > SelectAdditiveInputs(ILotUnitOfWork lotUnitOfWork)
        {
            var lotKey          = LotProjectors.SelectLotKey <LotProductionResults>();
            var lotProduct      = ProductProjectors.SelectProduct();
            var additiveLots    = LotProjectors.SelectAdditiveLot(lotUnitOfWork);
            var additiveProduct = ProductProjectors.SelectAdditiveProduct();
            var additiveLotKey  = LotProjectors.SelectLotKey <AdditiveLot>();

            return(r => new ProductionAdditiveInputs
            {
                ProductionDate = r.ProductionBegin,
                LotKeyReturn = lotKey.Invoke(r),
                LotProduct = lotProduct.Invoke(r.Production.ResultingChileLot.ChileProduct.Product),
                PickedAdditiveItems = r.Production.PickedInventory.Items.Select(i => new
                {
                    Item = i,
                    AdditiveLot = additiveLots.Invoke(i.Lot).FirstOrDefault()
                })
                                      .Where(i => i.AdditiveLot != null)
                                      .Select(i => new ProductionPickedAdditive
                {
                    LotKeyReturn = additiveLotKey.Invoke(i.AdditiveLot),
                    TotalPoundsPicked = i.Item.Quantity * i.Item.PackagingProduct.Weight,
                    AdditiveProduct = additiveProduct.Invoke(i.AdditiveLot.AdditiveProduct),
                    UserResultEntered = r.Employee.UserName
                })
            });
        }
コード例 #25
0
        internal static IEnumerable <Expression <Func <InventoryAdjustment, InventoryAdjustmentReturn> > > SplitSelect(ILotUnitOfWork lotUnitOfWork)
        {
            if (lotUnitOfWork == null)
            {
                throw new ArgumentNullException("lotUnitOfWork");
            }

            var key        = SelectKey();
            var notebook   = NotebookProjectors.Select();
            var selectItem = InventoryAdjustmentItemProjectors.Select(lotUnitOfWork);

            return(new[]
            {
                Projector <InventoryAdjustment> .To(a => new InventoryAdjustmentReturn
                {
                    InventoryAdjustmentKeyReturn = key.Invoke(a),

                    AdjustmentDate = a.AdjustmentDate,
                    User = a.Employee.UserName,
                    TimeStamp = a.TimeStamp,

                    Notebook = notebook.Invoke(a.Notebook)
                }),
                Projector <InventoryAdjustment> .To(a => new InventoryAdjustmentReturn
                {
                    Items = a.Items.Select(i => selectItem.Invoke(i))
                })
            });
        }
コード例 #26
0
 internal CreateNewChileLotCommand(ILotUnitOfWork lotUnitOfWork) : base(lotUnitOfWork)
 {
 }
コード例 #27
0
 public SyncLotHelper(RioAccessSQLEntities oldContext, ILotUnitOfWork unitOfWork, OldContextHelper oldContextHelper)
 {
     _oldContext       = oldContext;
     _unitOfWork       = unitOfWork;
     _oldContextHelper = oldContextHelper;
 }
コード例 #28
0
 internal LotTraceInputCommand(ILotUnitOfWork lotUnitOfWork)
 {
     _lotUnitOfWork = lotUnitOfWork;
 }
コード例 #29
0
 internal CreateNewPackagingLotCommand(ILotUnitOfWork lotUnitOfWork) : base(lotUnitOfWork)
 {
 }
コード例 #30
0
        private static IResult ResolveDefects(IEnumerable <LotAttributeDefect> unresolvedDefects, Parameters parameters, IDefectResolutionParameters resolution, ILotUnitOfWork unitOfWork)
        {
            var createResolutionCommand = new CreateLotDefectResolutionCommand(unitOfWork);
            var resolutionResult        = unresolvedDefects.Select(
                unresolvedDefect => createResolutionCommand.Execute(new CreateLotDefectResolutionParameters
            {
                LotDefect      = unresolvedDefect.LotDefect,
                Employee       = parameters.Employee,
                TimeStamp      = parameters.TimeStamp,
                ResolutionType = resolution.ResolutionType,
                Description    = resolution.Description
            }))
                                          .FirstOrDefault(r => !r.Success);

            return(resolutionResult as IResult ?? new SuccessResult());
        }