Example #1
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var receipt = this.PaymentWherePaymentApplication;

            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.IsMarked(this) || changeSet.IsCreated(this) || changeSet.HasChangedRoles(this))
            {
                if (receipt != null)
                {
                    iteration.AddDependency(receipt, this);
                    iteration.Mark(receipt);
                }

                if (this.ExistInvoiceItem)
                {
                    iteration.AddDependency(this.InvoiceItem, this);
                    iteration.Mark(this.InvoiceItem);

                    foreach (OrderItemBilling orderItemBilling in this.InvoiceItem.OrderItemBillingsWhereInvoiceItem)
                    {
                        iteration.AddDependency(orderItemBilling.OrderItem, this);
                        iteration.Mark(orderItemBilling.OrderItem);
                    }
                }

                if (this.ExistInvoice)
                {
                    iteration.AddDependency(this.Invoice, this);
                    iteration.Mark(this.Invoice);
                }
            }
        }
Example #2
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;
            var salesOrder = this.SalesOrderWhereSalesOrderItem;

            if (iteration.IsMarked(this) || changeSet.IsCreated(this) || changeSet.HasChangedRoles(this))
            {
                iteration.AddDependency(salesOrder, this);
                iteration.Mark(salesOrder);

                foreach (SalesOrderItem featureItem in this.OrderedWithFeatures)
                {
                    iteration.AddDependency(this, featureItem);
                    iteration.Mark(featureItem);
                }

                if (this.ExistReservedFromNonSerialisedInventoryItem)
                {
                    iteration.AddDependency(this, this.ReservedFromNonSerialisedInventoryItem);
                    iteration.Mark(this.ReservedFromNonSerialisedInventoryItem);
                }

                if (this.ExistReservedFromSerialisedInventoryItem)
                {
                    iteration.AddDependency(this, this.ReservedFromSerialisedInventoryItem);
                    iteration.Mark(this.ReservedFromSerialisedInventoryItem);
                }

                if (this.ExistSerialisedItem)
                {
                    iteration.AddDependency(this.SerialisedItem, this);
                    iteration.Mark(this.SerialisedItem);
                }
            }
        }
Example #3
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;
            var singleton = this.Strategy.Session.GetSingleton();

            if (iteration.IsMarked(this) || changeSet.IsCreated(this) || changeSet.HasChangedRoles(this))
            {
                iteration.AddDependency(this, singleton);
                iteration.Mark(singleton);

                if (this.ExistTakenViaSupplier)
                {
                    iteration.AddDependency(this, this.TakenViaSupplier);
                    iteration.Mark(this.TakenViaSupplier);
                }

                if (this.ExistTakenViaSubcontractor)
                {
                    iteration.AddDependency(this, this.TakenViaSubcontractor);
                    iteration.Mark(this.TakenViaSubcontractor);
                }

                foreach (PurchaseOrderItem orderItem in this.PurchaseOrderItems)
                {
                    iteration.AddDependency(this, orderItem);
                    iteration.Mark(orderItem);
                }
            }
        }
Example #4
0
        public void CustomOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            //TODO: check for change
            iteration.AddDependency(this.ScoreboardWhereGame, this);
        }
Example #5
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistSalesInvoiceWhereSalesInvoiceItem)
            {
                derivation.AddDependency(this.SalesInvoiceWhereSalesInvoiceItem, this);
            }

            if (this.ExistPaymentApplicationsWhereInvoiceItem)
            {
                foreach (PaymentApplication paymentApplication in this.PaymentApplicationsWhereInvoiceItem)
                {
                    derivation.AddDependency(this, paymentApplication);
                }
            }

            foreach (OrderItemBilling orderItemBilling in this.OrderItemBillingsWhereInvoiceItem)
            {
                derivation.AddDependency(orderItemBilling.OrderItem, this);
            }

            foreach (ShipmentItemBilling shipmentItemBilling in this.ShipmentItemBillingsWhereInvoiceItem)
            {
                foreach (OrderShipment orderShipment in shipmentItemBilling.ShipmentItem.OrderShipmentsWhereShipmentItem)
                {
                    derivation.AddDependency(orderShipment.OrderItem, this);
                }
            }
        }
Example #6
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            iteration.AddDependency(this, this.Party.SalesOrdersWhereBillToCustomer);
            iteration.AddDependency(this, this.Party.SalesInvoicesWhereBillToCustomer);
        }
Example #7
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.IsMarked(this) || changeSet.IsCreated(this) || changeSet.HasChangedRoles(this))
            {
                iteration.AddDependency(this.PrimaryParent, this);
                iteration.Mark(this.PrimaryParent);

                foreach (Object parent in this.SecondaryParents)
                {
                    iteration.AddDependency(parent, this);
                    iteration.Mark(parent);
                }

                if (this.ExistPreviousSecondaryParents && this.PreviousSecondaryParents.Count > this.SecondaryParents.Count)
                {
                    var removedSecondaryParents = this.PreviousSecondaryParents.Except(this.SecondaryParents);

                    foreach (Object removedParent in removedSecondaryParents)
                    {
                        iteration.Mark(removedParent);
                    }
                }
            }
        }
Example #8
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (derivation.HasChangedRoles(this))
            {
                if (this.ExistPriceableWhereDiscountAdjustment)
                {
                    var salesInvoiceItem = this.PriceableWhereDiscountAdjustment as SalesInvoiceItem;
                    var salesOrderItem   = this.PriceableWhereDiscountAdjustment as SalesOrderItem;

                    if (salesInvoiceItem != null)
                    {
                        derivation.AddDependency(this, salesInvoiceItem);
                    }

                    if (salesOrderItem != null)
                    {
                        derivation.AddDependency(this, salesOrderItem);
                    }
                }

                if (this.ExistOrderWhereDiscountAdjustment)
                {
                    var salesOrder = (SalesOrder)this.OrderWhereDiscountAdjustment;
                    derivation.AddDependency(this, salesOrder);
                }

                if (this.ExistInvoiceWhereDiscountAdjustment)
                {
                    var salesInvoice = (SalesInvoice)this.InvoiceWhereDiscountAdjustment;
                    derivation.AddDependency(this, salesInvoice);
                }
            }
        }
Example #9
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.IsMarked(this) || changeSet.IsCreated(this) || changeSet.HasChangedRoles(this))
            {
                if (this.ExistSubContractor)
                {
                    iteration.AddDependency(this.SubContractor, this);
                    iteration.Mark(this.SubContractor);

                    foreach (OrganisationContactRelationship contactRelationship in this.SubContractor.OrganisationContactRelationshipsWhereOrganisation)
                    {
                        iteration.AddDependency(this, contactRelationship);
                        iteration.Mark(contactRelationship);
                    }
                }

                if (this.ExistContractor)
                {
                    iteration.AddDependency(this.Contractor, this);
                    iteration.Mark(this.Contractor);
                }
            }
        }
Example #10
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.IsMarked(this) || changeSet.IsCreated(this) || changeSet.HasChangedRoles(this))
            {
                foreach (ShipmentItem shipmentItem in this.ShipmentItems)
                {
                    iteration.AddDependency(this, shipmentItem);
                    iteration.Mark(shipmentItem);

                    foreach (OrderShipment orderShipment in shipmentItem.OrderShipmentsWhereShipmentItem)
                    {
                        if (orderShipment.ExistOrderItem && !orderShipment.Strategy.IsNewInSession)
                        {
                            iteration.AddDependency(this, orderShipment.OrderItem);
                            iteration.Mark(orderShipment.OrderItem);
                        }
                    }
                }

                foreach (ShipmentPackage shipmentPackage in this.ShipmentPackages)
                {
                    iteration.AddDependency(this, shipmentPackage);
                    iteration.Mark(shipmentPackage);
                }
            }
        }
        public static void BaseOnPreDerive(this OrderAdjustment @this, ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.ChangeSet.Associations.Contains(@this.Id))
            {
                if (@this.ExistOrderWhereOrderAdjustment)
                {
                    var order = @this.OrderWhereOrderAdjustment;
                    iteration.AddDependency(@this, order);
                    iteration.Mark(order);
                }

                if (@this.ExistInvoiceWhereOrderAdjustment)
                {
                    var invoice = @this.InvoiceWhereOrderAdjustment;
                    iteration.AddDependency(@this, invoice);
                    iteration.Mark(invoice);
                }

                if (@this.ExistQuoteWhereOrderAdjustment)
                {
                    var quote = @this.QuoteWhereOrderAdjustment;
                    iteration.AddDependency(@this, quote);
                    iteration.Mark(quote);
                }
            }
        }
Example #12
0
File: C1.cs Project: whesius/allors
 public void TestOnPreDerive(ObjectOnPreDerive method)
 {
     var derivation = method.Derivation;
     foreach (Object dependency in this.Dependencies)
     {
         derivation.AddDependency(this, dependency);
     }
 }
Example #13
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (PaymentApplication paymentApplication in this.PaymentApplications)
            {
                derivation.AddDependency(this, paymentApplication);
            }
        }
Example #14
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistBankAccount && derivation.ChangeSet.GetRoleTypes(this.Id).Contains(this.Meta.BankAccount))
            {
                derivation.AddDerivable(this.BankAccount);
            }
        }
Example #15
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (PartyContactMechanism partyContactMechanism in this.PartyContactMechanismsWhereContactMechanism)
            {
                derivation.AddDependency(partyContactMechanism, this);
            }
        }
Example #16
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistEmployee)
            {
                derivation.AddDependency(this.Employee, this);
            }
        }
Example #17
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistPartyWherePartyContactMechanism)
            {
                derivation.AddDependency(this.PartyWherePartyContactMechanism, this);
            }
        }
Example #18
0
        public void CustomOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (Object dependency in this.Dependencies)
            {
                derivation.AddDependency(this, dependency);
            }
        }
Example #19
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (derivation.IsModified(this) && this.ExistPartyWherePartyContactMechanism)
            {
                derivation.AddDependency(this.PartyWherePartyContactMechanism, this);
            }
        }
Example #20
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistWorkEffort)
            {
                derivation.AddDependency(this.WorkEffort, this);
            }
        }
Example #21
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistSalesRep)
            {
                derivation.AddDependency(this.SalesRep, this);
            }
        }
Example #22
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (PartyContactMechanism partyContactMechanism in this.PartyContactMechanismsWhereContactMechanism)
            {
                derivation.AddDependency(partyContactMechanism, this);
            }
        }
Example #23
0
        public void CustomOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (Object invoice in this.Invoices)
            {
                derivation.AddDependency(this, invoice);
            }
        }
Example #24
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (PaymentApplication paymentApplication in this.PaymentApplications)
            {
                derivation.AddDependency(this, paymentApplication);
            }
        }
Example #25
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            derivation.AddDependency(this.Organisation, this);
            derivation.MarkAsModified(this.Organisation, M.OrganisationContactRelationship.Organisation);

            derivation.AddDependency(this.Contact, this);
        }
Example #26
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (Object parent in this.Parents)
            {
                derivation.AddDependency(parent, this);
            }
        }
Example #27
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.Part != null)
            {
                derivation.AddDependency(this.Part, this);
            }
        }
Example #28
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (Role role in this.RolesWherePermission)
            {
                derivation.AddDependency(role, this);
            }
        }
Example #29
0
        public static void BaseOnPreDerive(this WorkItem @this, ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (var task in @this.TasksWhereWorkItem.Where(v => !v.ExistDateClosed))
            {
                derivation.AddDependency(task, @this);
            }
        }
Example #30
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistBankAccount && derivation.ChangeSet.GetRoleTypes(this.Id).Contains(this.Meta.BankAccount))
            {
                derivation.AddDerivable(this.BankAccount);
            }
        }
Example #31
0
        public static void BaseOnPreDerive(this Task @this, ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (TaskAssignment taskAssignment in @this.TaskAssignmentsWhereTask)
            {
                derivation.AddDependency(taskAssignment, @this);
            }
        }
        public static void BaseOnPreDerive(this InventoryItem @this, ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.IsMarked(@this) || changeSet.IsCreated(@this) || changeSet.HasChangedRoles(@this))
            {
                iteration.AddDependency(@this.Part, @this);
                iteration.Mark(@this.Part);
            }
        }
Example #33
0
        public void CustomOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.IsMarked(this) || (!changeSet.IsCreated(this) && changeSet.HasChangedRoles(this, RelationKind.Regular)))
            {
                iteration.AddDependency(this, this.SyncRootWhereSyncDepth1);
                iteration.Mark(this.SyncRootWhereSyncDepth1);
            }
        }
Example #34
0
        public void CustomOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            //TODO: check for change
            foreach (Object score in this.Scores)
            {
                iteration.AddDependency(score, this);
            }
        }
Example #35
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            // TODO:
            if (derivation.ChangeSet.Associations.Contains(this.Id))
            {
                derivation.AddDependency(this.ShipmentItem, this);
            }
        }
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.IsMarked(this) || changeSet.IsCreated(this) || changeSet.HasChangedRoles(this))
            {
                iteration.AddDependency(this.Part, this);
                iteration.Mark(this.Part);
            }
        }
Example #37
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            // TODO:
            if (derivation.ChangeSet.Associations.Contains(this.Id))
            {
                derivation.AddDependency(this.ShipmentItem, this);
            }
        }
Example #38
0
        public void BaseOnPreDerive(ObjectOnPreDerive method)
        {
            var(iteration, changeSet, derivedObjects) = method;

            if (iteration.IsMarked(this) || changeSet.IsCreated(this) || changeSet.HasChangedRoles(this))
            {
                iteration.Mark(this.Employer);
                iteration.Mark(this.Employee);
            }
        }
Example #39
0
 public static void BaseOnPreDerive(this Object @this, ObjectOnPreDerive method)
 {
     var derivation = method.Derivation;
     var changeSet = derivation.ChangeSet;
     if (derivation.IsForced(@this.Id) || changeSet.Associations.Contains(@this.Id) || changeSet.Created.Contains(@this.Id))
     {
         if (!derivation.DerivedObjects.Contains(@this))
         {
             derivation.AddDerivable(@this);
         }
     }
 }
Example #40
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            // TODO:
            if (derivation.ChangeSet.Associations.Contains(this.Id))
            {
                var receipt = this.PaymentWherePaymentApplication as Receipt;
                if (receipt != null)
                {
                    derivation.AddDependency(receipt, this);
                }

                if (this.ExistInvoiceItem)
                {
                    derivation.AddDependency(this.InvoiceItem, this);
                }

                if (this.ExistInvoice)
                {
                    derivation.AddDependency(this.Invoice, this);
                }
            }
        }
Example #41
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistSupplier)
            {
                derivation.AddDerivable(this.Supplier);

                foreach (OrganisationContactRelationship contactRelationship in this.Supplier.OrganisationContactRelationshipsWhereOrganisation)
                {
                    derivation.AddDerivable(contactRelationship);
                }
            }
        }
Example #42
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            foreach (ShipmentItem shipmentItem in this.ShipmentItems)
            {
                derivation.AddDependency(this, shipmentItem);

                foreach (OrderShipment orderShipment in shipmentItem.OrderShipmentsWhereShipmentItem)
                {
                    if (orderShipment.ExistSalesOrderItem)
                    {
                        derivation.AddDependency(this, orderShipment.SalesOrderItem);
                    }

                    if (orderShipment.ExistPurchaseOrderItem)
                    {
                        derivation.AddDependency(this, orderShipment.PurchaseOrderItem);
                    }
                }
            }

            foreach (ShipmentPackage shipmentPackage in this.ShipmentPackages)
            {
                derivation.AddDependency(this, shipmentPackage);
            }
        }
Example #43
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            // TODO:
            if (derivation.ChangeSet.Associations.Contains(this.Id))
            {
                foreach (PickListItem pickListItem in this.PickListItems)
                {
                    derivation.AddDependency(this, pickListItem);

                    var inventoryItem = pickListItem.InventoryItem as Allors.Domain.NonSerializedInventoryItem;
                    if (inventoryItem != null)
                    {
                        derivation.AddDependency(this, inventoryItem);
                    }
                }

                if (this.ExistShipToParty)
                {
                    foreach (var customerShipment in this.ShipToParty.AppsGetPendingCustomerShipments())
                    {
                        derivation.AddDependency(customerShipment, this);
                    }
                }
            }
        }
Example #44
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            // TODO:
            if (derivation.ChangeSet.Associations.Contains(this.Id))
            {
                if (this.ExistClientRelationshipsWhereClient)
                {
                    foreach (ClientRelationship relationship in this.ClientRelationshipsWhereClient)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (CustomerRelationship relationship in this.CustomerRelationshipsWhereCustomer)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (Employment relationship in this.EmploymentsWhereEmployee)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (OrganisationContactRelationship relationship in this.OrganisationContactRelationshipsWhereContact)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (ProfessionalServicesRelationship relationship in this.ProfessionalServicesRelationshipsWhereProfessional)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (SalesRepRelationship relationship in this.SalesRepRelationshipsWhereSalesRepresentative)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (SubContractorRelationship relationship in this.SubContractorRelationshipsWhereContractor)
                    {
                        derivation.AddDependency(relationship, this);
                    }
                }
            }
        }
Example #45
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            // TODO:
            if (derivation.ChangeSet.Associations.Contains(this.Id))
            {
                if (this.ExistBilledToInternalOrganisation)
                {
                    derivation.AddDependency(this, this.BilledToInternalOrganisation);
                }
            }

            if (this.ExistBilledFromParty)
            {
                var supplier = this.BilledFromParty as Organisation;
                if (supplier != null)
                {
                    var supplierRelationships = supplier.SupplierRelationshipsWhereSupplier;
                    supplierRelationships.Filter.AddEquals(SupplierRelationships.Meta.InternalOrganisation, this.BilledToInternalOrganisation);

                    foreach (SupplierRelationship supplierRelationship in supplierRelationships)
                    {
                        if (supplierRelationship.FromDate <= DateTime.UtcNow && (!supplierRelationship.ExistThroughDate || supplierRelationship.ThroughDate >= DateTime.UtcNow))
                        {
                            derivation.AddDependency(this, supplierRelationship);
                        }
                    }
                }
            }
        }
Example #46
0
 public void AppsOnPreDerive(ObjectOnPreDerive method)
 {
     var derivation = method.Derivation;
     derivation.AddDependency(this.Party, this);
 }
Example #47
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistSalesInvoiceWhereSalesInvoiceItem)
            {
                derivation.AddDependency(this.SalesInvoiceWhereSalesInvoiceItem, this);
            }

            if (this.ExistPaymentApplicationsWhereInvoiceItem)
            {
                foreach (PaymentApplication paymentApplication in this.PaymentApplicationsWhereInvoiceItem)
                {
                    derivation.AddDependency(this, paymentApplication);
                }
            }

            if (this.ExistSalesOrderItem)
            {
                derivation.AddDependency(this.SalesOrderItem, this);
            }

            if (this.ExistShipmentItemWhereInvoiceItem)
            {
                derivation.AddDependency(this.ShipmentItemWhereInvoiceItem, this);
            }
        }
Example #48
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistCustomer)
            {
                derivation.AddDependency(this, this.Customer);

                var customer = this.Customer as Organisation;
                if (customer != null)
                {
                    foreach (OrganisationContactRelationship contactRelationship in customer.OrganisationContactRelationshipsWhereOrganisation)
                    {
                        derivation.AddDerivable(contactRelationship);
                    }
                }
            }
        }
Example #49
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            // TODO:
            if (derivation.ChangeSet.Associations.Contains(this.Id))
            {
                if (this.ExistClientRelationshipsWhereClient)
                {
                    foreach (ClientRelationship relationship in this.ClientRelationshipsWhereInternalOrganisation)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (CustomerRelationship relationship in this.CustomerRelationshipsWhereInternalOrganisation)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (DistributionChannelRelationship relationship in this.DistributionChannelRelationshipsWhereInternalOrganisation)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (Employment relationship in this.EmploymentsWhereEmployer)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (Partnership relationship in this.PartnershipsWhereInternalOrganisation)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (SalesRepRelationship relationship in this.SalesRepRelationshipsWhereInternalOrganisation)
                    {
                        derivation.AddDependency(relationship, this);
                    }

                    foreach (SupplierRelationship relationship in this.SupplierRelationshipsWhereInternalOrganisation)
                    {
                        derivation.AddDependency(relationship, this);
                    }
                }

                foreach (PaymentMethod paymentMethod in this.PaymentMethods)
                {
                    derivation.AddDependency(paymentMethod, this);
                }
            }
        }
Example #50
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistBillToCustomer)
            {
                var customerRelationships = this.BillToCustomer.CustomerRelationshipsWhereCustomer;
                customerRelationships.Filter.AddEquals(CustomerRelationships.Meta.InternalOrganisation, this.TakenByInternalOrganisation);

                foreach (CustomerRelationship customerRelationship in customerRelationships)
                {
                    if (customerRelationship.FromDate <= DateTime.UtcNow && (!customerRelationship.ExistThroughDate || customerRelationship.ThroughDate >= DateTime.UtcNow))
                    {
                        derivation.AddDependency(customerRelationship, this);
                    }
                }
            }

            if (this.ExistShipToCustomer)
            {
                var customerRelationships = this.ShipToCustomer.CustomerRelationshipsWhereCustomer;
                customerRelationships.Filter.AddEquals(CustomerRelationships.Meta.InternalOrganisation, this.TakenByInternalOrganisation);

                foreach (CustomerRelationship customerRelationship in customerRelationships)
                {
                    if (customerRelationship.FromDate <= DateTime.UtcNow && (!customerRelationship.ExistThroughDate || customerRelationship.ThroughDate >= DateTime.UtcNow))
                    {
                        derivation.AddDependency(customerRelationship, this);
                    }
                }
            }

            foreach (var orderItem in this.OrderItems)
            {
                derivation.AddDependency(this, orderItem);
            }
        }
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistOrganisation)
            {
                derivation.AddDependency(this.Organisation, this);
            }
        }
Example #52
0
        public void AppsOnPreDerive(ObjectOnPreDerive method)
        {
            var derivation = method.Derivation;

            // TODO:
            if (derivation.ChangeSet.Associations.Contains(this.Id))
            {
                foreach (ShipmentItem shipmentItem in this.ShipmentItems)
                {
                    if (shipmentItem.ShipmentReceiptWhereShipmentItem.ExistInventoryItem)
                    {
                        derivation.AddDependency(shipmentItem.ShipmentReceiptWhereShipmentItem.InventoryItem, this);
                    }
                }
            }
        }