本文整理汇总了C#中IDerivation类的典型用法代码示例。如果您正苦于以下问题:C# IDerivation类的具体用法?C# IDerivation怎么用?C# IDerivation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDerivation类属于命名空间,在下文中一共展示了IDerivation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: AppsOnDeriveInvolvedParties
public void AppsOnDeriveInvolvedParties(IDerivation derivation)
{
this.RemoveInvolvedParties();
this.AddInvolvedParty(this.Owner);
this.AddInvolvedParty(this.Originator);
this.AddInvolvedParty(this.Receiver);
if (this.ExistPartyRelationshipWhereCommunicationEvent)
{
foreach (Party party in this.PartyRelationshipWhereCommunicationEvent.Parties)
{
this.AddInvolvedParty(party);
}
}
}
开发者ID:Allors,项目名称:apps,代码行数:15,代码来源:WebSiteCommunication.cs
示例17: AppsOnDeriveRevenue
public void AppsOnDeriveRevenue(IDerivation derivation)
{
this.Revenue = 0;
var partyProductCategoryRevenues = this.ProductCategory.PartyProductCategoryRevenuesWhereProductCategory;
partyProductCategoryRevenues.Filter.AddEquals(PartyProductCategoryRevenues.Meta.InternalOrganisation, this.InternalOrganisation);
partyProductCategoryRevenues.Filter.AddEquals(PartyProductCategoryRevenues.Meta.Year, this.Year);
partyProductCategoryRevenues.Filter.AddEquals(PartyProductCategoryRevenues.Meta.Month, this.Month);
foreach (PartyProductCategoryRevenue productCategoryRevenue in partyProductCategoryRevenues)
{
this.Revenue += productCategoryRevenue.Revenue;
}
if (this.ProductCategory.ExistParents)
{
ProductCategoryRevenues.AppsFindOrCreateAsDependable(this.Strategy.Session, this);
}
var months = ((DateTime.UtcNow.Year - this.Year) * 12) + DateTime.UtcNow.Month - this.Month;
if (months <= 12)
{
var histories = this.ProductCategory.ProductCategoryRevenueHistoriesWhereProductCategory;
histories.Filter.AddEquals(ProductCategoryRevenueHistories.Meta.InternalOrganisation, this.InternalOrganisation);
var history = histories.First ?? new ProductCategoryRevenueHistoryBuilder(this.Strategy.Session)
.WithCurrency(this.Currency)
.WithInternalOrganisation(this.InternalOrganisation)
.WithProductCategory(this.ProductCategory)
.Build();
}
foreach (ProductCategory parentCategory in this.ProductCategory.Parents)
{
var productCategoryRevenues = parentCategory.ProductCategoryRevenuesWhereProductCategory;
productCategoryRevenues.Filter.AddEquals(ProductCategoryRevenues.Meta.InternalOrganisation, this.InternalOrganisation);
productCategoryRevenues.Filter.AddEquals(ProductCategoryRevenues.Meta.Year, this.Year);
productCategoryRevenues.Filter.AddEquals(ProductCategoryRevenues.Meta.Month, this.Month);
var productCategoryRevenue = productCategoryRevenues.First ?? new ProductCategoryRevenueBuilder(this.Strategy.Session)
.WithInternalOrganisation(this.InternalOrganisation)
.WithProductCategory(parentCategory)
.WithYear(this.Year)
.WithMonth(this.Month)
.WithCurrency(this.Currency)
.WithRevenue(0M)
.Build();
productCategoryRevenue.OnDerive(x => x.WithDerivation(derivation));
}
}
开发者ID:Allors,项目名称:apps,代码行数:48,代码来源:ProductCategoryRevenue.cs
示例18: AppsOnDeriveInventoryItem
public void AppsOnDeriveInventoryItem(IDerivation derivation)
{
if (this.ExistShipmentItem && this.ShipmentItem.ExistOrderShipmentsWhereShipmentItem)
{
var purchaseOrderItem = this.ShipmentItem.OrderShipmentsWhereShipmentItem[0].PurchaseOrderItem;
var order = purchaseOrderItem.PurchaseOrderWherePurchaseOrderItem;
if (purchaseOrderItem.ExistProduct)
{
var good = purchaseOrderItem.Product as Allors.Domain.Good;
if (good != null)
{
if (good.ExistFinishedGood)
{
if (!this.ExistInventoryItem || !this.InventoryItem.Part.Equals(good.FinishedGood))
{
var inventoryItems = good.FinishedGood.InventoryItemsWherePart;
inventoryItems.Filter.AddEquals(InventoryItems.Meta.Facility, order.ShipToBuyer.DefaultFacility);
this.InventoryItem = inventoryItems.First as Allors.Domain.NonSerializedInventoryItem;
}
}
else
{
if (!this.ExistInventoryItem || !this.InventoryItem.Good.Equals(good))
{
var inventoryItems = good.InventoryItemsWhereGood;
inventoryItems.Filter.AddEquals(InventoryItems.Meta.Facility, order.ShipToBuyer.DefaultFacility);
this.InventoryItem = inventoryItems.First as Allors.Domain.NonSerializedInventoryItem ??
new NonSerializedInventoryItemBuilder(this.Strategy.Session).WithGood(good).Build();
}
}
}
}
if (purchaseOrderItem.ExistPart)
{
if (!this.ExistInventoryItem || !this.InventoryItem.Part.Equals(purchaseOrderItem.Part))
{
var inventoryItems = purchaseOrderItem.Part.InventoryItemsWherePart;
inventoryItems.Filter.AddEquals(InventoryItems.Meta.Facility, order.ShipToBuyer.DefaultFacility);
this.InventoryItem = inventoryItems.First as Allors.Domain.NonSerializedInventoryItem;
}
}
}
}
开发者ID:Allors,项目名称:apps,代码行数:45,代码来源:ShipmentReceipt.cs
示例19: AppsCalculatePurchasePrice
public void AppsCalculatePurchasePrice(IDerivation derivation)
{
this.UnitPurchasePrice = 0;
if (this.ExistProduct &&
this.Product.ExistSupplierOfferingsWhereProduct &&
this.Product.SupplierOfferingsWhereProduct.Count == 1 &&
this.Product.SupplierOfferingsWhereProduct.First.ExistProductPurchasePrices)
{
ProductPurchasePrice productPurchasePrice = null;
var prices = this.Product.SupplierOfferingsWhereProduct.First.ProductPurchasePrices;
foreach (ProductPurchasePrice purchasePrice in prices)
{
if (purchasePrice.FromDate <= this.SalesOrderWhereSalesOrderItem.OrderDate &&
(!purchasePrice.ExistThroughDate || purchasePrice.ThroughDate >= this.SalesOrderWhereSalesOrderItem.OrderDate))
{
productPurchasePrice = purchasePrice;
}
}
if (productPurchasePrice == null)
{
var index = this.Product.SupplierOfferingsWhereProduct.First.ProductPurchasePrices.Count;
var lastKownPrice = this.Product.SupplierOfferingsWhereProduct.First.ProductPurchasePrices[index - 1];
productPurchasePrice = lastKownPrice;
}
if (productPurchasePrice != null)
{
this.UnitPurchasePrice = productPurchasePrice.Price;
if (!productPurchasePrice.UnitOfMeasure.Equals(this.Product.UnitOfMeasure))
{
foreach (UnitOfMeasureConversion unitOfMeasureConversion in productPurchasePrice.UnitOfMeasure.UnitOfMeasureConversions)
{
if (unitOfMeasureConversion.ToUnitOfMeasure.Equals(this.Product.UnitOfMeasure))
{
this.UnitPurchasePrice = decimal.Round(this.UnitPurchasePrice * (1 / unitOfMeasureConversion.ConversionFactor), 2);
}
}
}
}
}
}
开发者ID:Allors,项目名称:apps,代码行数:44,代码来源:SalesOrderItem.cs
示例20: AppsOnDeriveSequenceNumber
public void AppsOnDeriveSequenceNumber(IDerivation derivation)
{
var highestNumber = 0;
if (this.ExistShipmentWhereShipmentPackage)
{
foreach (ShipmentPackage shipmentPackage in this.ShipmentWhereShipmentPackage.ShipmentPackages)
{
if (shipmentPackage.ExistSequenceNumber && shipmentPackage.SequenceNumber > highestNumber)
{
highestNumber = shipmentPackage.SequenceNumber;
}
}
if (!this.ExistSequenceNumber || this.SequenceNumber == 0)
{
this.SequenceNumber = highestNumber + 1;
}
}
}
开发者ID:Allors,项目名称:apps,代码行数:19,代码来源:ShipmentPackage.cs
注:本文中的IDerivation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论