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))); }
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; }
public GetProductSpecCommand(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
internal DeleteLotConductor(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
internal SetLotAttributesConductor(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
public SetLotWeightedAttributesConductor(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
internal RemoveLotCommand(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
internal RecordLotHistoryCommand(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
internal UpdateChileLotStatusCommand(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
internal SetLotPackagingReceivedCommand(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
internal CreateInHouseContaminationDefectCommand(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
internal CreateLotDefectResolutionCommand(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } _lotUnitOfWork = lotUnitOfWork; }
protected CreateNewLotCommandBase(ILotUnitOfWork lotUnitOfWork) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } LotUnitOfWork = lotUnitOfWork; }
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); }
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); }
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()); }
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() ))); }
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 }); }
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))); }
internal LotTraceOutputCommand(ILotUnitOfWork lotUnitOfWork) { _lotUnitOfWork = lotUnitOfWork; _selectOutputs = LotProjectors.SelectLotOutputTrace(lotUnitOfWork); }
internal LotAllowancesCommand(ILotUnitOfWork lotUnitOfWork) { _lotUnitOfWork = lotUnitOfWork; }
public CreateNewAdditiveLotCommand(ILotUnitOfWork lotUnitOfWork) : base(lotUnitOfWork) { }
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 }) }); }
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)) }) }); }
internal CreateNewChileLotCommand(ILotUnitOfWork lotUnitOfWork) : base(lotUnitOfWork) { }
public SyncLotHelper(RioAccessSQLEntities oldContext, ILotUnitOfWork unitOfWork, OldContextHelper oldContextHelper) { _oldContext = oldContext; _unitOfWork = unitOfWork; _oldContextHelper = oldContextHelper; }
internal LotTraceInputCommand(ILotUnitOfWork lotUnitOfWork) { _lotUnitOfWork = lotUnitOfWork; }
internal CreateNewPackagingLotCommand(ILotUnitOfWork lotUnitOfWork) : base(lotUnitOfWork) { }
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()); }