public PackScheduleEntityObjectMother(RioAccessSQLEntities oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { _newContextHelper = new NewContextHelper(newContext); _packagingHelper = new PackSchedulePackagingHelper(oldContext.CreateObjectSet <tblPackaging>().ToList()); _notebookFactory = NotebookFactory.Create(newContext); _serializedData = new SerializedData(oldContext); }
public CustomerProductCodeMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { if (newContext == null) { throw new ArgumentNullException("newContext"); } _newContextHelper = new NewContextHelper(newContext); }
protected LotInventoryEntityObjectMotherBase(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { if (newContext == null) { throw new ArgumentNullException("newContext"); } NewContextHelper = new NewContextHelper(newContext); }
public LotEntityObjectMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { if (newContext == null) { throw new ArgumentNullException("newContext"); } _newContextHelper = new NewContextHelper(newContext); _createChileLotHelper = new CreateChileLotHelper(this, oldContext.CreateObjectSet <tblLotStatu>()); }
public ProductionScheduleEntityObjectMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { if (newContext == null) { throw new ArgumentNullException("newContext"); } _newContextHelper = new NewContextHelper(newContext); _loadCount = new MotherLoadCount <EntityTypes>(); }
public CompanyAndContactsMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback = null) : base(oldContext, loggingCallback) { if (newContext == null) { throw new ArgumentNullException("newContext"); } _newContext = newContext; _newContextHelper = new NewContextHelper(_newContext); }
public LotAllowancesEntityObjectMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { if (newContext == null) { throw new ArgumentNullException("newContext"); } _newContextHelper = new NewContextHelper(newContext); }
public InventoryAdjustmentsMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { if (newContext == null) { throw new ArgumentNullException("newContext"); } _newContextHelper = new NewContextHelper(newContext); _notebookFactory = NotebookFactory.Create(newContext); }
public ProductionBatchEntityObjectMother(RioAccessSQLEntities oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { if (newContext == null) { throw new ArgumentNullException("newContext"); } _newContextHelper = new NewContextHelper(newContext); _serializedData = new SerializedData(oldContext); _productionResultHelper = new ProductionResultHelper(_newContextHelper, _serializedData); _pickedInventoryItemLocationHelper = new PickedInventoryItemLocationHelper(_newContextHelper); _notebookFactory = NotebookFactory.Create(newContext); }
private IInventoryTreatmentKey DeterminedOrderTreatment(MovementOrderDTO order, SerializableMove deserialized) { if (deserialized != null && deserialized.TreatmentOrder != null && deserialized.TreatmentOrder.TreatmentKey != null) { return(deserialized.TreatmentOrder.TreatmentKey); } int treatmentId; if (order.ToWHID == null || !_treatmentIdsByFacility.TryGetValue(order.ToWHID.Value, out treatmentId)) { treatmentId = order.tblOutgoings.Where(o => o.TTypeID == (int)TransType.FrmTrmt) .Select(o => o.TrtmtID) .Distinct().FirstOrDefault(i => i != 0); if (treatmentId == 0) { return(null); } } return(NewContextHelper.GetInventoryTreatment(treatmentId)); }
public LotHistoryEntityObjectMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { _newContextHelper = new NewContextHelper(newContext); }
protected override IDerivedLot GetLot(LotKey lotKey) { return(NewContextHelper.GetPackagingLotWithProduct(lotKey)); }
public SalesQuoteEntityObjectMother(RioValleyChiliDataContext newContext, ObjectContext oldContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { _newContextHelper = new NewContextHelper(newContext); }
public ChileMaterialsReceivedEntityMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { _newContext = newContext; _newContextHelper = new NewContextHelper(_newContext); }
public MillAndWetdownMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> analyzerCallback) : base(oldContext, analyzerCallback) { _newContextHelper = new NewContextHelper(newContext); }
protected override IEnumerable <TreatmentOrder> BirthRecords() { foreach (var order in SelectMovementOrdersToLoad()) { var entityType = GetEntityType(order.TTypeID); LoadCount.AddRead(entityType); if (order.EntryDate == null) { Log(new CallbackParameters(CallbackReason.NullEntryDate) { MovementOrder = order }); continue; } var dateCreated = order.EntryDate.Value.ConvertLocalToUTC().Date; var sourceFacility = NewContextHelper.GetFacility(order.FromWHID); if (sourceFacility == null) { Log(new CallbackParameters(CallbackReason.SourceWarehouseNotLoaded) { MovementOrder = order }); continue; } var destinationFacility = NewContextHelper.GetFacility(order.ToWHID); if (destinationFacility == null) { Log(new CallbackParameters(CallbackReason.TreatmentFaciltyNotLoaded) { MovementOrder = order }); continue; } destinationFacility.FacilityType = FacilityType.Treatment; var deserialized = SerializableMove.Deserialize(order.Serialized); var treatment = DeterminedOrderTreatment(order, deserialized); if (treatment == null) { Log(new CallbackParameters(CallbackReason.TreatmentNotDetermined) { MovementOrder = order }); continue; } var shipmentDate = order.Date.GetDate() ?? order.EntryDate.GetDate(); if (shipmentDate == null) { Log(new CallbackParameters(CallbackReason.UndeterminedShipmentDate) { MovementOrder = order }); continue; } var sequence = PickedInventoryKeyHelper.Singleton.GetNextSequence(dateCreated); var shipmentOrder = SetOrderProperties(new InventoryShipmentOrder { DateCreated = dateCreated, Sequence = sequence, ShipmentInfoDateCreated = dateCreated, ShipmentInfoSequence = NewContextHelper.ShipmentInformationKeys.GetNextSequence(dateCreated), DestinationFacilityId = destinationFacility.Id, SourceFacilityId = sourceFacility.Id }, order); if (shipmentOrder == null) { continue; } var treatmentOrder = new TreatmentOrder { DateCreated = dateCreated, Sequence = sequence, InventoryTreatmentId = treatment.InventoryTreatmentKey_Id, InventoryShipmentOrder = shipmentOrder, Returned = order.Returned.ConvertLocalToUTC() }; treatmentOrder.InventoryShipmentOrder.ShipmentInformation = CreateShipmentInformation(treatmentOrder.InventoryShipmentOrder, order); treatmentOrder.InventoryShipmentOrder.InventoryPickOrder = CreateInventoryPickOrder(treatmentOrder.InventoryShipmentOrder, order); treatmentOrder.InventoryShipmentOrder.PickedInventory = CreatePickedInventory(treatmentOrder.InventoryShipmentOrder, order, treatmentOrder.InventoryShipmentOrder.ShipmentInformation.Status); if (treatmentOrder.InventoryShipmentOrder.PickedInventory == null) { continue; } treatmentOrder.InventoryShipmentOrder.PickedInventory.Items.ForEach(i => i.TreatmentId = NewContextHelper.NoTreatment.Id); if (deserialized != null) { deserialized.SetOrder(treatmentOrder); } LoadCount.AddLoaded(entityType); LoadCount.AddLoaded(EntityTypes.InventoryShipmentOrder); LoadCount.AddLoaded(EntityTypes.PickOrder); LoadCount.AddLoaded(EntityTypes.PickOrderItem, (uint)treatmentOrder.InventoryShipmentOrder.InventoryPickOrder.Items.Count); LoadCount.AddLoaded(EntityTypes.PickedInventory); LoadCount.AddLoaded(EntityTypes.PickedInventoryItem, (uint)treatmentOrder.InventoryShipmentOrder.PickedInventory.Items.Count); LoadCount.AddLoaded(EntityTypes.ShipmentInformation); yield return(treatmentOrder); } LoadCount.LogResults(l => Log(new CallbackParameters(l))); }
public ContractEntityObjectMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { _newContextHelper = new NewContextHelper(newContext); _notebookFactory = NotebookFactory.Create(newContext); }
protected override IEnumerable <InventoryShipmentOrder> BirthRecords() { LoadCount.Reset(); foreach (var order in SelectMovementOrdersToLoad()) { var entityType = GetEntityType(order.TTypeID); LoadCount.AddRead(entityType); if (order.EntryDate == null) { Log(new CallbackParameters(CallbackReason.NullEntryDate) { MovementOrder = order }); continue; } var dateCreated = order.EntryDate.Value.ConvertLocalToUTC().Date; var sequence = PickedInventoryKeyHelper.Singleton.GetNextSequence(dateCreated); var sourceWarehouse = NewContextHelper.GetFacility(order.FromWHID); if (sourceWarehouse == null) { Log(new CallbackParameters(CallbackReason.SourceWarehouseNotLoaded) { MovementOrder = order }); continue; } var destinationWarehouse = NewContextHelper.GetFacility(order.ToWHID); if (destinationWarehouse == null) { Log(new CallbackParameters(CallbackReason.DestinationWarehouseNotLoaded) { MovementOrder = order }); continue; } var shipmentInformationSequence = NewContextHelper.ShipmentInformationKeys.GetNextSequence(dateCreated); var shipmentOrder = SetOrderProperties(new InventoryShipmentOrder { DateCreated = dateCreated, Sequence = sequence, ShipmentInfoDateCreated = dateCreated, ShipmentInfoSequence = shipmentInformationSequence, DestinationFacilityId = destinationWarehouse.Id, SourceFacilityId = sourceWarehouse.Id }, order); if (shipmentOrder == null) { continue; } shipmentOrder.ShipmentInformation = CreateShipmentInformation(shipmentOrder, order); shipmentOrder.InventoryPickOrder = CreateInventoryPickOrder(shipmentOrder, order); shipmentOrder.PickedInventory = CreatePickedInventory(shipmentOrder, order, shipmentOrder.ShipmentInformation.Status); if (shipmentOrder.PickedInventory == null) { continue; } var deserialized = SerializableMove.Deserialize(order.Serialized); if (deserialized != null) { deserialized.SetOrder(shipmentOrder); } LoadCount.AddLoaded(entityType); LoadCount.AddLoaded(EntityTypes.InventoryShipmentOrder); LoadCount.AddLoaded(EntityTypes.PickOrder); LoadCount.AddLoaded(EntityTypes.PickOrderItem, (uint)shipmentOrder.InventoryPickOrder.Items.Count); LoadCount.AddLoaded(EntityTypes.PickedInventory); LoadCount.AddLoaded(EntityTypes.PickedInventoryItem, (uint)shipmentOrder.PickedInventory.Items.Count); LoadCount.AddLoaded(EntityTypes.ShipmentInformation); yield return(shipmentOrder); } LoadCount.LogResults(l => Log(new CallbackParameters(l))); }
public CustomerProductSpecMother(ObjectContext oldContext, RioValleyChiliDataContext newContext, Action <CallbackParameters> loggingCallback) : base(oldContext, loggingCallback) { _newContextHelper = new NewContextHelper(newContext); }