本文整理汇总了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));
}
}
}
示例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));
}
}
示例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));
}
示例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));
}
}
示例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);
}
}
}
}
示例6: AppsOnDeriveAmountPaid
public void AppsOnDeriveAmountPaid(IDerivation derivation)
{
this.AmountPaid = 0;
foreach (PaymentApplication paymentApplication in this.PaymentApplicationsWhereInvoiceItem)
{
this.AmountPaid += paymentApplication.AmountApplied;
this.AppsPaymentReceived(derivation);
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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));
}
}
}
示例11: AppsOnDeriveCustomerShipmentItem
public void AppsOnDeriveCustomerShipmentItem(IDerivation derivation)
{
if (this.ShipmentWhereShipmentItem is CustomerShipment)
{
this.QuantityShipped = 0;
foreach (PackagingContent packagingContent in PackagingContentsWhereShipmentItem)
{
this.QuantityShipped += packagingContent.Quantity;
}
}
}
示例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();
}
}
}
}
}
}
}
示例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();
}
}
}
示例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);
}
}
}
示例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);
}
}
}