当前位置: 首页>>代码示例>>C#>>正文


C# IDerivation类代码示例

本文整理汇总了C#中IDerivation的典型用法代码示例。如果您正苦于以下问题:C# IDerivation类的具体用法?C# IDerivation怎么用?C# IDerivation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IDerivation类属于命名空间,在下文中一共展示了IDerivation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AppsDepleteSalesOrders

        public void AppsDepleteSalesOrders(IDerivation derivation)
        {
            Extent<SalesOrderItem> salesOrderItems = this.Strategy.Session.Extent<SalesOrderItem>();
            salesOrderItems.Filter.AddEquals(SalesOrderItems.Meta.CurrentObjectState, new SalesOrderItemObjectStates(this.Strategy.Session).InProcess);
            salesOrderItems.AddSort(SalesOrderItems.Meta.DeliveryDate, SortDirection.Descending);

            salesOrderItems = this.Strategy.Session.Instantiate(salesOrderItems);

            var subtract = this.PreviousQuantityOnHand - this.QuantityOnHand;

            foreach (SalesOrderItem salesOrderItem in salesOrderItems)
            {
                if (subtract > 0 && salesOrderItem.QuantityRequestsShipping > 0)
                {
                    decimal diff;
                    if (subtract >= salesOrderItem.QuantityRequestsShipping)
                    {
                        diff = salesOrderItem.QuantityRequestsShipping;
                    }
                    else
                    {
                        diff = subtract;
                    }

                    subtract -= diff;

                    salesOrderItem.AppsOnDeriveSubtractFromShipping(derivation, diff);
                    salesOrderItem.SalesOrderWhereSalesOrderItem.OnDerive(x => x.WithDerivation(derivation));
                }
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:31,代码来源:NonSerializedInventoryItem.cs

示例2: AppsOnDeriveRevenue

        public void AppsOnDeriveRevenue(IDerivation derivation)
        {
            this.Revenue = 0;

            var toDate = DateTimeFactory.CreateDate(this.Year, this.Month, 01).AddMonths(1);

            var invoices = this.Party.SalesInvoicesWhereBillToCustomer;
            invoices.Filter.AddEquals(SalesInvoices.Meta.BilledFromInternalOrganisation, this.InternalOrganisation);
            invoices.Filter.AddNot().AddEquals(SalesInvoices.Meta.CurrentObjectState, new SalesInvoiceObjectStates(this.Strategy.Session).WrittenOff);
            invoices.Filter.AddBetween(SalesInvoices.Meta.InvoiceDate, DateTimeFactory.CreateDate(this.Year, this.Month, 01), toDate);

            foreach (SalesInvoice salesInvoice in invoices)
            {
                foreach (SalesInvoiceItem salesInvoiceItem in salesInvoice.SalesInvoiceItems)
                {
                    if (salesInvoiceItem.ExistSalesRep && salesInvoiceItem.SalesRep.Equals(this.SalesRep))
                    {
                        this.Revenue += salesInvoiceItem.TotalExVat;
                    }
                }
            }

            if (this.ExistSalesRep)
            {
                var salesRepRevenue = SalesRepRevenues.AppsFindOrCreateAsDependable(this.Strategy.Session, this);
                salesRepRevenue.OnDerive(x => x.WithDerivation(derivation));
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:28,代码来源:SalesRepPartyRevenue.cs

示例3: AppsOnDeriveRevenue

        public void AppsOnDeriveRevenue(IDerivation derivation)
        {
            this.Revenue = 0;

            var toDate = DateTimeFactory.CreateDate(this.Year, this.Month, 01).AddMonths(1);

            var invoices = this.Store.SalesInvoicesWhereStore;
            invoices.Filter.AddNot().AddEquals(SalesInvoices.Meta.CurrentObjectState, new SalesInvoiceObjectStates(this.Strategy.Session).WrittenOff);
            invoices.Filter.AddBetween(SalesInvoices.Meta.InvoiceDate, DateTimeFactory.CreateDate(this.Year, this.Month, 01), toDate);

            foreach (SalesInvoice salesInvoice in invoices)
            {
                this.Revenue += salesInvoice.TotalExVat;
            }

            var months = ((DateTime.UtcNow.Year - this.Year) * 12) + DateTime.UtcNow.Month - this.Month;
            if (months <= 12)
            {
                var histories = this.Store.StoreRevenueHistoriesWhereStore;
                histories.Filter.AddEquals(StoreRevenueHistories.Meta.InternalOrganisation, this.InternalOrganisation);
                var history = histories.First ?? new StoreRevenueHistoryBuilder(this.Strategy.Session)
                                                     .WithCurrency(this.Currency)
                                                     .WithInternalOrganisation(this.InternalOrganisation)
                                                     .WithStore(this.Store)
                                                     .Build();

                history.AppsOnDeriveRevenue();
            }

            var internalOrganisationRevenue = InternalOrganisationRevenues.AppsFindOrCreateAsDependable(this.Strategy.Session, this);
            internalOrganisationRevenue.OnDerive(x => x.WithDerivation(derivation));
        }
开发者ID:Allors,项目名称:apps,代码行数:32,代码来源:StoreRevenue.cs

示例4: AppsOnDeriveRevenue

        public void AppsOnDeriveRevenue(IDerivation derivation)
        {
            this.Revenue = 0;

            var partyProductRevenues = this.Product.PartyProductRevenuesWhereProduct;
            partyProductRevenues.Filter.AddEquals(PartyProductRevenues.Meta.InternalOrganisation, this.InternalOrganisation);
            partyProductRevenues.Filter.AddEquals(PartyProductRevenues.Meta.Year, this.Year);
            partyProductRevenues.Filter.AddEquals(PartyProductRevenues.Meta.Month, this.Month);

            foreach (PartyProductRevenue partyProductRevenue in partyProductRevenues)
            {
                this.Revenue += partyProductRevenue.Revenue;
            }

            var months = ((DateTime.UtcNow.Year - this.Year) * 12) + DateTime.UtcNow.Month - this.Month;
            if (months <= 12)
            {
                var histories = this.Product.ProductRevenueHistoriesWhereProduct;
                histories.Filter.AddEquals(ProductRevenueHistories.Meta.InternalOrganisation, this.InternalOrganisation);
                var history = histories.First ?? new ProductRevenueHistoryBuilder(this.Strategy.Session)
                                                     .WithCurrency(this.Currency)
                                                     .WithInternalOrganisation(this.InternalOrganisation)
                                                     .WithProduct(this.Product)
                                                     .Build();
            }

            foreach (ProductCategory productCategory in this.Product.ProductCategories)
            {
                productCategory.OnDerive(x => x.WithDerivation(derivation));
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:31,代码来源:ProductRevenue.cs

示例5: AppsOnDeriveCustomerContactMemberShip

 public void AppsOnDeriveCustomerContactMemberShip(IDerivation derivation)
 {
     if (this.ExistContact && this.ExistOrganisation && this.Organisation.ExistCustomerContactUserGroup)
     {
         if (this.FromDate <= DateTime.UtcNow && (!this.ExistThroughDate || this.ThroughDate >= DateTime.UtcNow))
         {
             if (this.Organisation.AppsIsActiveCustomer(this.FromDate))
             {
                 if (!this.Organisation.CustomerContactUserGroup.ContainsMember(this.Contact))
                 {
                     this.Organisation.CustomerContactUserGroup.AddMember(this.Contact);
                 }
             }
             else
             {
                 if (this.Organisation.CustomerContactUserGroup.ContainsMember(this.Contact))
                 {
                     this.Organisation.CustomerContactUserGroup.RemoveMember(this.Contact);
                 }
             }
         }
         else
         {
             if (this.Organisation.CustomerContactUserGroup.ContainsMember(this.Contact))
             {
                 this.Organisation.CustomerContactUserGroup.RemoveMember(this.Contact);
             }
         }
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:30,代码来源:OrganisationContactRelationship.cs

示例6: AppsOnDeriveAmountPaid

 public void AppsOnDeriveAmountPaid(IDerivation derivation)
 {
     this.AmountPaid = 0;
     foreach (PaymentApplication paymentApplication in this.PaymentApplicationsWhereInvoiceItem)
     {
         this.AmountPaid += paymentApplication.AmountApplied;
         this.AppsPaymentReceived(derivation);
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:9,代码来源:SalesInvoiceItem.cs

示例7: AppsOnDeriveCurrentObjectState

 public void AppsOnDeriveCurrentObjectState(IDerivation derivation)
 {
     if (this.ExistCurrentObjectState && !this.CurrentObjectState.Equals(this.LastObjectState))
     {
         var currentStatus = new PurchaseReturnStatusBuilder(this.Strategy.Session).WithPurchaseReturnObjectState(this.CurrentObjectState).Build();
         this.AddShipmentStatus(currentStatus);
         this.CurrentShipmentStatus = currentStatus;
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:9,代码来源:PurchaseReturn.cs

示例8: AppsOnDerivePurchaseShipmentItem

 public void AppsOnDerivePurchaseShipmentItem(IDerivation derivation)
 {
     if (this.ShipmentWhereShipmentItem is PurchaseShipment)
     {
         this.Quantity = 0;
         var shipmentReceipt = this.ShipmentReceiptWhereShipmentItem;
         this.Quantity += shipmentReceipt.QuantityAccepted + shipmentReceipt.QuantityRejected;
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:9,代码来源:ShipmentItem.cs

示例9: AppsOnDeriveCurrentObjectState

        public void AppsOnDeriveCurrentObjectState(IDerivation derivation)
        {
            if (this.ExistCurrentObjectState && !this.CurrentObjectState.Equals(this.LastObjectState))
            {
                SerializedInventoryItemStatus currentStatus = new SerializedInventoryItemStatusBuilder(this.Strategy.Session).WithSerializedInventoryItemObjectState(this.CurrentObjectState).Build();
                this.AddInventoryItemStatus(currentStatus);
                this.CurrentInventoryItemStatus = currentStatus;
            }

            this.AppsOnDeriveProductCategories(derivation);
        }
开发者ID:Allors,项目名称:apps,代码行数:11,代码来源:SerializedInventoryItem.cs

示例10: AppsOnDerivePartnerContacts

 public void AppsOnDerivePartnerContacts(IDerivation derivation)
 {
     if (this.ExistPartner)
     {
         var partner = this.Partner;
         foreach (OrganisationContactRelationship contactRelationship in partner.OrganisationContactRelationshipsWhereOrganisation)
         {
             contactRelationship.Contact.OnDerive(x => x.WithDerivation(derivation));
         }
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:11,代码来源:Partnership.cs

示例11: AppsOnDeriveCustomerShipmentItem

 public void AppsOnDeriveCustomerShipmentItem(IDerivation derivation)
 {
     if (this.ShipmentWhereShipmentItem is CustomerShipment)
     {
         this.QuantityShipped = 0;
         foreach (PackagingContent packagingContent in PackagingContentsWhereShipmentItem)
         {
             this.QuantityShipped += packagingContent.Quantity;
         }
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:11,代码来源:ShipmentItem.cs

示例12: AppsOnDeriveInventoryItem

        public void AppsOnDeriveInventoryItem(IDerivation derivation)
        {
            Good good = null;
            if (this.ExistProduct)
            {
                good = this.Product as Good;
            }

            var supplier = this.Supplier as Organisation;
            if (supplier != null && good != null)
            {
                if (good.ExistInventoryItemKind && good.InventoryItemKind.Equals(new InventoryItemKinds(this.Strategy.Session).NonSerialized))
                {
                    foreach (SupplierRelationship supplierRelationship in supplier.SupplierRelationshipsWhereSupplier)
                    {
                        foreach (Facility facility in supplierRelationship.InternalOrganisation.FacilitiesWhereOwner)
                        {
                            var inventoryItems = good.InventoryItemsWhereGood;
                            inventoryItems.Filter.AddEquals(InventoryItems.Meta.Facility, facility);
                            var inventoryItem = inventoryItems.First;

                            if (inventoryItem == null)
                            {
                                new NonSerializedInventoryItemBuilder(this.Strategy.Session).WithFacility(facility).WithGood(good).Build();
                            }
                        }
                    }
                }
                else
                {
                    if (good.ExistFinishedGood &&
                        good.FinishedGood.ExistInventoryItemKind &&
                        good.FinishedGood.InventoryItemKind.Equals(new InventoryItemKinds(this.Strategy.Session).NonSerialized))
                    {
                        foreach (SupplierRelationship supplierRelationship in supplier.SupplierRelationshipsWhereSupplier)
                        {
                            foreach (Facility facility in supplierRelationship.InternalOrganisation.FacilitiesWhereOwner)
                            {
                                var inventoryItems = good.FinishedGood.InventoryItemsWherePart;
                                inventoryItems.Filter.AddEquals(InventoryItems.Meta.Facility, facility);
                                var inventoryItem = inventoryItems.First;

                                if (inventoryItem == null)
                                {
                                    new NonSerializedInventoryItemBuilder(this.Strategy.Session).WithFacility(facility).WithPart(good.FinishedGood).Build();
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:52,代码来源:SupplierOffering.cs

示例13: AppsOnDeriveInventoryItem

 public static void AppsOnDeriveInventoryItem(this Part @this, IDerivation derivation)
 {
     if (@this.ExistInventoryItemKind && @this.InventoryItemKind.Equals(new InventoryItemKinds(@this.Strategy.Session).NonSerialized))
     {
         if ([email protected])
         {
             new NonSerializedInventoryItemBuilder(@this.Strategy.Session)
                 .WithFacility(@this.OwnedByParty.DefaultFacility)
                 .WithPart(@this)
                 .Build();
         }
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:13,代码来源:PartExtensions.cs

示例14: AppsOnDeriveProductCategories

        public static void AppsOnDeriveProductCategories(this InventoryItem @this, IDerivation derivation)
        {
            @this.RemoveDerivedProductCategories();

            if (@this.ExistGood)
            {
                foreach (ProductCategory productCategory in @this.Good.ProductCategories)
                {
                    @this.AddDerivedProductCategory(productCategory);
                    @this.AddParentCategories(productCategory);
                }
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:13,代码来源:InventoryitemExtensions.cs

示例15: AppsOnDeriveInvolvedParties

        public void AppsOnDeriveInvolvedParties(IDerivation derivation)
        {
            this.InvolvedParties = this.Participants;
            this.AddInvolvedParty(this.Owner);

            if (this.ExistPartyRelationshipWhereCommunicationEvent)
            {
                foreach (Party party in this.PartyRelationshipWhereCommunicationEvent.Parties)
                {
                    this.AddInvolvedParty(party);
                }
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:13,代码来源:FaceToFaceCommunication.cs


注:本文中的IDerivation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。