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


C# ISession.Extent方法代码示例

本文整理汇总了C#中ISession.Extent方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.Extent方法的具体用法?C# ISession.Extent怎么用?C# ISession.Extent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISession的用法示例。


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

示例1: DeriveCommissions

 public static void DeriveCommissions(ISession session)
 {
     foreach (SalesRepRelationship salesRepRelationship in session.Extent<SalesRepRelationship>())
     {
         salesRepRelationship.AppsOnDeriveCommission();
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:7,代码来源:SalesRepRelationships.cs

示例2: Instance

        public static Singleton Instance(ISession session)
        {
            var instance = (Singleton)session[SessionKey] ?? session.Extent<Singleton>().First;

            session[SessionKey] = instance;
            return instance;
        }
开发者ID:whesius,项目名称:allors,代码行数:7,代码来源:Singleton.cs

示例3: AppsOnDeriveRevenues

 public static void AppsOnDeriveRevenues(ISession session)
 {
     foreach (Party party in session.Extent<Party>())
     {
         party.AppsOnDeriveRevenue();
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:7,代码来源:Parties.cs

示例4: AppsOnDeriveRevenues

 public static void AppsOnDeriveRevenues(ISession session)
 {
     var derivation = new Derivation(session);
     foreach (CustomerRelationship customerRelationship in session.Extent<CustomerRelationship>())
     {
         customerRelationship.AppsOnDeriveRevenue(derivation);
     }
 }
开发者ID:Allors,项目名称:apps,代码行数:8,代码来源:CustomerRelationships.cs

示例5: GetObjects

        protected IObject[] GetObjects(ISession session, Composite objectType)
        {
            if (session is IDatabaseSession)
            {
                return session.Extent(objectType);
            }

            var workspaceSess = (IWorkspaceSession)session;
            return workspaceSess.LocalExtent(objectType);
        }
开发者ID:whesius,项目名称:allors,代码行数:10,代码来源:DomainTest.cs

示例6: GetExtent

 private IObject[] GetExtent(ISession session, IComposite objectType)
 {
     return session.Extent(objectType);
 }
开发者ID:whesius,项目名称:allors,代码行数:4,代码来源:SerializationTest.cs

示例7: GetObjects

 protected IObject[] GetObjects(ISession session, Composite objectType)
 {
     return session.Extent(objectType);
 }
开发者ID:Allors,项目名称:apps,代码行数:4,代码来源:DomainTest.cs

示例8: ExtentByCode

 public static Extent<Country> ExtentByCode(ISession session)
 {
     return session.Extent(Countries.Meta.ObjectType).AddSort(Countries.Meta.IsoCode);
 }
开发者ID:whesius,项目名称:allors,代码行数:4,代码来源:Countries.cs

示例9: Extent

 public static Person[] Extent(ISession session)
 {
     return (Person[])session.Extent(Meta.ObjectType).ToArray();
 }
开发者ID:whesius,项目名称:allors,代码行数:4,代码来源:Person.cs

示例10: Extent

 public static Sandbox[] Extent(ISession session)
 {
     return (Sandbox[])session.Extent(Meta.ObjectType).ToArray();
 }
开发者ID:whesius,项目名称:allors,代码行数:4,代码来源:Sandbox.cs

示例11: AppsOnDeriveRevenues

        public static void AppsOnDeriveRevenues(ISession session)
        {
            var internalOrganisationRevenuesByPeriodByInternalOrganisation = new Dictionary<InternalOrganisation, Dictionary<DateTime, InternalOrganisationRevenue>>();

            var internalOrganisationRevenues = session.Extent<InternalOrganisationRevenue>();

            foreach (InternalOrganisationRevenue internalOrganisationRevenue in internalOrganisationRevenues)
            {
                internalOrganisationRevenue.Revenue = 0;
                var date = DateTimeFactory.CreateDate(internalOrganisationRevenue.Year, internalOrganisationRevenue.Month, 01);

                Dictionary<DateTime, InternalOrganisationRevenue> internalOrganisationRevenuesByPeriod;
                if (!internalOrganisationRevenuesByPeriodByInternalOrganisation.TryGetValue(internalOrganisationRevenue.InternalOrganisation, out internalOrganisationRevenuesByPeriod))
                {
                    internalOrganisationRevenuesByPeriod = new Dictionary<DateTime, InternalOrganisationRevenue>();
                    internalOrganisationRevenuesByPeriodByInternalOrganisation[internalOrganisationRevenue.InternalOrganisation] = internalOrganisationRevenuesByPeriod;
                }

                InternalOrganisationRevenue revenue;
                if (!internalOrganisationRevenuesByPeriod.TryGetValue(date, out revenue))
                {
                    internalOrganisationRevenuesByPeriod.Add(date, internalOrganisationRevenue);
                }
            }

            var revenues = new HashSet<long>();

            var salesInvoices = session.Extent<SalesInvoice>();
            var year = 0;
            foreach (SalesInvoice salesInvoice in salesInvoices)
            {
                if (year != salesInvoice.InvoiceDate.Year)
                {
                    session.Commit();
                    year = salesInvoice.InvoiceDate.Year;
                }

                var date = DateTimeFactory.CreateDate(salesInvoice.InvoiceDate.Year, salesInvoice.InvoiceDate.Month, 01);

                foreach (SalesInvoiceItem salesInvoiceItem in salesInvoice.SalesInvoiceItems)
                {
                    if (salesInvoice.ExistBilledFromInternalOrganisation)
                    {
                        InternalOrganisationRevenue internalOrganisationRevenue;

                        Dictionary<DateTime, InternalOrganisationRevenue> internalOrganisationRevenuesByPeriod;
                        if (!internalOrganisationRevenuesByPeriodByInternalOrganisation.TryGetValue(salesInvoice.BilledFromInternalOrganisation, out internalOrganisationRevenuesByPeriod))
                        {
                            internalOrganisationRevenue = CreateInternalOrganisationRevenue(session, salesInvoice);

                            internalOrganisationRevenuesByPeriod = new Dictionary<DateTime, InternalOrganisationRevenue> { { date, internalOrganisationRevenue } };

                            internalOrganisationRevenuesByPeriodByInternalOrganisation[salesInvoice.BilledFromInternalOrganisation] = internalOrganisationRevenuesByPeriod;
                        }

                        if (!internalOrganisationRevenuesByPeriod.TryGetValue(date, out internalOrganisationRevenue))
                        {
                            internalOrganisationRevenue = CreateInternalOrganisationRevenue(session, salesInvoice);
                            internalOrganisationRevenuesByPeriod[date] = internalOrganisationRevenue;
                        }

                        revenues.Add(internalOrganisationRevenue.Id);
                        internalOrganisationRevenue.Revenue += salesInvoiceItem.TotalExVat;
                    }
                }
            }

            foreach (InternalOrganisationRevenue internalOrganisationRevenue in internalOrganisationRevenues)
            {
                if (!revenues.Contains(internalOrganisationRevenue.Id))
                {
                    internalOrganisationRevenue.Delete();
                }
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:75,代码来源:InternalOrganisationRevenues.cs

示例12: AppsOnDeriveRevenues

        public static void AppsOnDeriveRevenues(ISession session)
        {
            var storeRevenuesByPeriodByStoreByInternalOrganisation = new Dictionary<InternalOrganisation, Dictionary<Store, Dictionary<DateTime, StoreRevenue>>>();

            var storeRevenues = session.Extent<StoreRevenue>();

            foreach (StoreRevenue storeRevenue in storeRevenues)
            {
                storeRevenue.Revenue = 0;
                var date = DateTimeFactory.CreateDate(storeRevenue.Year, storeRevenue.Month, 01);

                Dictionary<Store, Dictionary<DateTime, StoreRevenue>> storeRevenuesByPeriodByStore;
                if (!storeRevenuesByPeriodByStoreByInternalOrganisation.TryGetValue(storeRevenue.InternalOrganisation, out storeRevenuesByPeriodByStore))
                {
                    storeRevenuesByPeriodByStore = new Dictionary<Store, Dictionary<DateTime, StoreRevenue>>();
                    storeRevenuesByPeriodByStoreByInternalOrganisation[storeRevenue.InternalOrganisation] = storeRevenuesByPeriodByStore;
                }

                Dictionary<DateTime, StoreRevenue> storeRevenuesByPeriod;
                if (!storeRevenuesByPeriodByStore.TryGetValue(storeRevenue.Store, out storeRevenuesByPeriod))
                {
                    storeRevenuesByPeriod = new Dictionary<DateTime, StoreRevenue>();
                    storeRevenuesByPeriodByStore[storeRevenue.Store] = storeRevenuesByPeriod;
                }

                StoreRevenue revenue;
                if (!storeRevenuesByPeriod.TryGetValue(date, out revenue))
                {
                    storeRevenuesByPeriod.Add(date, storeRevenue);
                }
            }

            var revenues = new HashSet<long>();

            var salesInvoices = session.Extent<SalesInvoice>();
            var year = 0;
            foreach (SalesInvoice salesInvoice in salesInvoices)
            {
                if (year != salesInvoice.InvoiceDate.Year)
                {
                    session.Commit();
                    year = salesInvoice.InvoiceDate.Year;
                }

                var date = DateTimeFactory.CreateDate(salesInvoice.InvoiceDate.Year, salesInvoice.InvoiceDate.Month, 01);

                foreach (SalesInvoiceItem salesInvoiceItem in salesInvoice.SalesInvoiceItems)
                {
                    StoreRevenue storeRevenue;

                    Dictionary<Store, Dictionary<DateTime, StoreRevenue>> storeRevenuesByPeriodByStore;
                    if (!storeRevenuesByPeriodByStoreByInternalOrganisation.TryGetValue(salesInvoice.BilledFromInternalOrganisation, out storeRevenuesByPeriodByStore))
                    {
                        storeRevenue = CreateStoreRevenue(session, salesInvoice);

                        storeRevenuesByPeriodByStore = new Dictionary<Store, Dictionary<DateTime, StoreRevenue>>
                        {
                            { salesInvoice.Store, new Dictionary<DateTime, StoreRevenue> { { date, storeRevenue } } }
                        };

                        storeRevenuesByPeriodByStoreByInternalOrganisation[salesInvoice.BilledFromInternalOrganisation] = storeRevenuesByPeriodByStore;
                    }

                    Dictionary<DateTime, StoreRevenue> storeRevenuesByPeriod;
                    if (!storeRevenuesByPeriodByStore.TryGetValue(salesInvoice.Store, out storeRevenuesByPeriod))
                    {
                        storeRevenue = CreateStoreRevenue(session, salesInvoice);

                        storeRevenuesByPeriod = new Dictionary<DateTime, StoreRevenue>
                        {
                            { date, storeRevenue }
                        };

                        storeRevenuesByPeriodByStore[salesInvoice.Store] = storeRevenuesByPeriod;
                    }

                    if (!storeRevenuesByPeriod.TryGetValue(date, out storeRevenue))
                    {
                        storeRevenue = CreateStoreRevenue(session, salesInvoice);
                        storeRevenuesByPeriod.Add(date, storeRevenue);
                    }

                    revenues.Add(storeRevenue.Id);
                    storeRevenue.Revenue += salesInvoiceItem.TotalExVat;
                }
            }

            foreach (StoreRevenue storeRevenue in storeRevenues)
            {
                if (!revenues.Contains(storeRevenue.Id))
                {
                    storeRevenue.Delete();
                }
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:95,代码来源:StoreRevenues.cs

示例13: AppsOnDeriveRevenues

        public static void AppsOnDeriveRevenues(ISession session)
        {
            var partyPackageRevenuesByPeriodByPackageByPartyByInternalOrganisation = new Dictionary<InternalOrganisation, Dictionary<Party, Dictionary<Package, Dictionary<DateTime, PartyPackageRevenue>>>>();

            var partyPackageRevenues = session.Extent<PartyPackageRevenue>();

            foreach (PartyPackageRevenue partyPackageRevenue in partyPackageRevenues)
            {
                partyPackageRevenue.Revenue = 0;
                var date = DateTimeFactory.CreateDate(partyPackageRevenue.Year, partyPackageRevenue.Month, 01);

                Dictionary<Party, Dictionary<Package, Dictionary<DateTime, PartyPackageRevenue>>> partyPackageRevenuesByPeriodByPackageByParty;
                if (!partyPackageRevenuesByPeriodByPackageByPartyByInternalOrganisation.TryGetValue(partyPackageRevenue.InternalOrganisation, out partyPackageRevenuesByPeriodByPackageByParty))
                {
                    partyPackageRevenuesByPeriodByPackageByParty = new Dictionary<Party, Dictionary<Package, Dictionary<DateTime, PartyPackageRevenue>>>();
                    partyPackageRevenuesByPeriodByPackageByPartyByInternalOrganisation[partyPackageRevenue.InternalOrganisation] = partyPackageRevenuesByPeriodByPackageByParty;
                }

                Dictionary<Package, Dictionary<DateTime, PartyPackageRevenue>> partyPackageRevenuesByPeriodByPackage;
                if (!partyPackageRevenuesByPeriodByPackageByParty.TryGetValue(partyPackageRevenue.Party, out partyPackageRevenuesByPeriodByPackage))
                {
                    partyPackageRevenuesByPeriodByPackage = new Dictionary<Package, Dictionary<DateTime, PartyPackageRevenue>>();
                    partyPackageRevenuesByPeriodByPackageByParty[partyPackageRevenue.Party] = partyPackageRevenuesByPeriodByPackage;
                }

                Dictionary<DateTime, PartyPackageRevenue> partyPackageRevenuesByPeriod;
                if (!partyPackageRevenuesByPeriodByPackage.TryGetValue(partyPackageRevenue.Package, out partyPackageRevenuesByPeriod))
                {
                    partyPackageRevenuesByPeriod = new Dictionary<DateTime, PartyPackageRevenue>();
                    partyPackageRevenuesByPeriodByPackage[partyPackageRevenue.Package] = partyPackageRevenuesByPeriod;
                }

                PartyPackageRevenue revenue;
                if (!partyPackageRevenuesByPeriod.TryGetValue(date, out revenue))
                {
                    partyPackageRevenuesByPeriod.Add(date, partyPackageRevenue);
                }
            }

            var revenues = new HashSet<long>();

            var salesInvoices = session.Extent<SalesInvoice>();
            var year = 0;
            foreach (SalesInvoice salesInvoice in salesInvoices)
            {
                if (year != salesInvoice.InvoiceDate.Year)
                {
                    session.Commit();
                    year = salesInvoice.InvoiceDate.Year;
                }

                var date = DateTimeFactory.CreateDate(salesInvoice.InvoiceDate.Year, salesInvoice.InvoiceDate.Month, 01);

                foreach (SalesInvoiceItem salesInvoiceItem in salesInvoice.SalesInvoiceItems)
                {
                    if (salesInvoiceItem.ExistProduct && salesInvoiceItem.Product.ExistPrimaryProductCategory && salesInvoiceItem.Product.PrimaryProductCategory.ExistPackage)
                    {
                        CreatePackageRevenue(session, partyPackageRevenuesByPeriodByPackageByPartyByInternalOrganisation, date, revenues, salesInvoiceItem, salesInvoiceItem.Product.PrimaryProductCategory.Package);
                    }
                }
            }

            foreach (PartyPackageRevenue partyPackageRevenue in partyPackageRevenues)
            {
                if (!revenues.Contains(partyPackageRevenue.Id))
                {
                    partyPackageRevenue.Delete();
                }
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:70,代码来源:PartyPackageRevenues.cs

示例14: AppsOnDeriveHistory

        public static void AppsOnDeriveHistory(ISession session)
        {
            var derivation = new Derivation(session);

            var packageRevenuesByPeriodByPackageByInternalOrganisation = new Dictionary<InternalOrganisation, Dictionary<Package, Dictionary<DateTime, PackageRevenue>>>();

            var packageRevenues = session.Extent<PackageRevenue>();

            foreach (PackageRevenue packageRevenue in packageRevenues)
            {
                var months = ((DateTime.UtcNow.Year - packageRevenue.Year) * 12) + DateTime.UtcNow.Month - packageRevenue.Month;
                if (months <= 12)
                {
                    var date = DateTimeFactory.CreateDate(packageRevenue.Year, packageRevenue.Month, 01);

                    Dictionary<Package, Dictionary<DateTime, PackageRevenue>> packageRevenuesByPeriodByPackage;
                    if (!packageRevenuesByPeriodByPackageByInternalOrganisation.TryGetValue(packageRevenue.InternalOrganisation, out packageRevenuesByPeriodByPackage))
                    {
                        packageRevenuesByPeriodByPackage = new Dictionary<Package, Dictionary<DateTime, PackageRevenue>>();
                        packageRevenuesByPeriodByPackageByInternalOrganisation[packageRevenue.InternalOrganisation] = packageRevenuesByPeriodByPackage;
                    }

                    Dictionary<DateTime, PackageRevenue> packageRevenuesByPeriod;
                    if (!packageRevenuesByPeriodByPackage.TryGetValue(packageRevenue.Package, out packageRevenuesByPeriod))
                    {
                        packageRevenuesByPeriod = new Dictionary<DateTime, PackageRevenue>();
                        packageRevenuesByPeriodByPackage[packageRevenue.Package] = packageRevenuesByPeriod;
                    }

                    PackageRevenue revenue;
                    if (!packageRevenuesByPeriod.TryGetValue(date, out revenue))
                    {
                        packageRevenuesByPeriod.Add(date, packageRevenue);
                    }
                }
            }

            var packageRevenueHistoriesByPackageByInternalOrganisation = new Dictionary<InternalOrganisation, Dictionary<Package, PackageRevenueHistory>>();

            var packageRevenueHistories = session.Extent<PackageRevenueHistory>();

            foreach (PackageRevenueHistory packageRevenueHistory in packageRevenueHistories)
            {
                packageRevenueHistory.Revenue = 0;

                Dictionary<Package, PackageRevenueHistory> packageRevenueHistoriesByPackage;
                if (!packageRevenueHistoriesByPackageByInternalOrganisation.TryGetValue(packageRevenueHistory.InternalOrganisation, out packageRevenueHistoriesByPackage))
                {
                    packageRevenueHistoriesByPackage = new Dictionary<Package, PackageRevenueHistory>();
                    packageRevenueHistoriesByPackageByInternalOrganisation[packageRevenueHistory.InternalOrganisation] = packageRevenueHistoriesByPackage;
                }

                PackageRevenueHistory revenueHistory;
                if (!packageRevenueHistoriesByPackage.TryGetValue(packageRevenueHistory.Package, out revenueHistory))
                {
                    packageRevenueHistoriesByPackage.Add(packageRevenueHistory.Package, packageRevenueHistory);
                }
            }

            foreach (var keyValuePair in packageRevenuesByPeriodByPackageByInternalOrganisation)
            {
                Dictionary<Package, PackageRevenueHistory> packageRevenueHistoriesByPackage;
                if (!packageRevenueHistoriesByPackageByInternalOrganisation.TryGetValue(keyValuePair.Key, out packageRevenueHistoriesByPackage))
                {
                    packageRevenueHistoriesByPackage = new Dictionary<Package, PackageRevenueHistory>();
                    packageRevenueHistoriesByPackageByInternalOrganisation[keyValuePair.Key] = packageRevenueHistoriesByPackage;
                }

                foreach (var valuePair in keyValuePair.Value)
                {
                    PackageRevenueHistory packageRevenueHistory;

                    if (!packageRevenueHistoriesByPackage.TryGetValue(valuePair.Key, out packageRevenueHistory))
                    {
                        PackageRevenue partyRevenue = null;
                        foreach (var packageRevenuesByPeriod in valuePair.Value)
                        {
                            partyRevenue = packageRevenuesByPeriod.Value;
                            break;
                        }

                        packageRevenueHistory = CreatePackageRevenueHistory(session, partyRevenue);
                        packageRevenueHistoriesByPackage.Add(packageRevenueHistory.Package, packageRevenueHistory);
                    }

                    foreach (var partyRevenueByPeriod in valuePair.Value)
                    {
                        var partyRevenue = partyRevenueByPeriod.Value;
                        packageRevenueHistory.Revenue += partyRevenue.Revenue;
                    }

                    packageRevenueHistory.OnDerive(x => x.WithDerivation(derivation));
                }
            }
        }
开发者ID:Allors,项目名称:apps,代码行数:95,代码来源:PackageRevenueHistories.cs

示例15: AppsOnDeriveHistory

        public static void AppsOnDeriveHistory(ISession session)
        {
            var partyProductRevenuesByPeriodByProductByPartyByInternalOrganisation =
                new Dictionary<InternalOrganisation, Dictionary<Party, Dictionary<Product, Dictionary<DateTime, PartyProductRevenue>>>>();

            var partyProductRevenues = session.Extent<PartyProductRevenue>();

            foreach (PartyProductRevenue partyProductRevenue in partyProductRevenues)
            {
                var months = ((DateTime.UtcNow.Year - partyProductRevenue.Year) * 12) + DateTime.UtcNow.Month - partyProductRevenue.Month;
                if (months <= 12)
                {
                    var date = DateTimeFactory.CreateDate(partyProductRevenue.Year, partyProductRevenue.Month, 01);

                    Dictionary<Party, Dictionary<Product, Dictionary<DateTime, PartyProductRevenue>>> partyProductRevenuesByPeriodByProductByParty;
                    if (!partyProductRevenuesByPeriodByProductByPartyByInternalOrganisation.TryGetValue(partyProductRevenue.InternalOrganisation, out partyProductRevenuesByPeriodByProductByParty))
                    {
                        partyProductRevenuesByPeriodByProductByParty = new Dictionary<Party, Dictionary<Product, Dictionary<DateTime, PartyProductRevenue>>>();
                        partyProductRevenuesByPeriodByProductByPartyByInternalOrganisation[partyProductRevenue.InternalOrganisation] = partyProductRevenuesByPeriodByProductByParty;
                    }

                    Dictionary<Product, Dictionary<DateTime, PartyProductRevenue>> partyProductRevenuesByPeriodByproduct;
                    if (!partyProductRevenuesByPeriodByProductByParty.TryGetValue(partyProductRevenue.Party, out partyProductRevenuesByPeriodByproduct))
                    {
                        partyProductRevenuesByPeriodByproduct = new Dictionary<Product, Dictionary<DateTime, PartyProductRevenue>>();
                        partyProductRevenuesByPeriodByProductByParty[partyProductRevenue.Party] = partyProductRevenuesByPeriodByproduct;
                    }

                    Dictionary<DateTime, PartyProductRevenue> partyProductRevenuesByPeriod;
                    if (!partyProductRevenuesByPeriodByproduct.TryGetValue(partyProductRevenue.Product, out partyProductRevenuesByPeriod))
                    {
                        partyProductRevenuesByPeriod = new Dictionary<DateTime, PartyProductRevenue>();
                        partyProductRevenuesByPeriodByproduct[partyProductRevenue.Product] = partyProductRevenuesByPeriod;
                    }

                    PartyProductRevenue revenue;
                    if (!partyProductRevenuesByPeriod.TryGetValue(date, out revenue))
                    {
                        partyProductRevenuesByPeriod.Add(date, partyProductRevenue);
                    }
                }
            }

            var partyProductRevenueHistoriesByProductByPartyByInternalOrganisation = new Dictionary<InternalOrganisation, Dictionary<Party, Dictionary<Product, PartyProductRevenueHistory>>>();

            var partyProductRevenueHistories = session.Extent<PartyProductRevenueHistory>();

            foreach (PartyProductRevenueHistory partyProductRevenueHistory in partyProductRevenueHistories)
            {
                partyProductRevenueHistory.Revenue = 0;

                Dictionary<Party, Dictionary<Product, PartyProductRevenueHistory>> partyProductRevenueHistoriesByProductByParty;
                if (!partyProductRevenueHistoriesByProductByPartyByInternalOrganisation.TryGetValue(partyProductRevenueHistory.InternalOrganisation, out partyProductRevenueHistoriesByProductByParty))
                {
                    partyProductRevenueHistoriesByProductByParty = new Dictionary<Party, Dictionary<Product, PartyProductRevenueHistory>>();
                    partyProductRevenueHistoriesByProductByPartyByInternalOrganisation[partyProductRevenueHistory.InternalOrganisation] = partyProductRevenueHistoriesByProductByParty;
                }

                Dictionary<Product, PartyProductRevenueHistory> partyProductRevenueHistoriesByProduct;
                if (!partyProductRevenueHistoriesByProductByParty.TryGetValue(partyProductRevenueHistory.Party, out partyProductRevenueHistoriesByProduct))
                {
                    partyProductRevenueHistoriesByProduct = new Dictionary<Product, PartyProductRevenueHistory>();
                    partyProductRevenueHistoriesByProductByParty[partyProductRevenueHistory.Party] = partyProductRevenueHistoriesByProduct;
                }

                PartyProductRevenueHistory revenueHistory;
                if (!partyProductRevenueHistoriesByProduct.TryGetValue(partyProductRevenueHistory.Product, out revenueHistory))
                {
                    partyProductRevenueHistoriesByProduct.Add(partyProductRevenueHistory.Product, partyProductRevenueHistory);
                }
            }

            foreach (var keyValuePair in partyProductRevenuesByPeriodByProductByPartyByInternalOrganisation)
            {
                Dictionary<Party, Dictionary<Product, PartyProductRevenueHistory>> partyProductRevenueHistoriesByProductByParty;
                if (!partyProductRevenueHistoriesByProductByPartyByInternalOrganisation.TryGetValue(keyValuePair.Key, out partyProductRevenueHistoriesByProductByParty))
                {
                    partyProductRevenueHistoriesByProductByParty = new Dictionary<Party, Dictionary<Product, PartyProductRevenueHistory>>();
                    partyProductRevenueHistoriesByProductByPartyByInternalOrganisation[keyValuePair.Key] = partyProductRevenueHistoriesByProductByParty;
                }

                foreach (var partyProductRevenuesByPeriodByProductByParty in keyValuePair.Value)
                {
                    Dictionary<Product, PartyProductRevenueHistory> partyProductRevenueHistoriesByProduct;
                    if (!partyProductRevenueHistoriesByProductByParty.TryGetValue(partyProductRevenuesByPeriodByProductByParty.Key, out partyProductRevenueHistoriesByProduct))
                    {
                        partyProductRevenueHistoriesByProduct = new Dictionary<Product, PartyProductRevenueHistory>();
                        partyProductRevenueHistoriesByProductByParty[keyValuePair.Key] = partyProductRevenueHistoriesByProduct;
                    }

                    foreach (var partyProductRevenuesByPeriodByProduct in partyProductRevenuesByPeriodByProductByParty.Value)
                    {
                        PartyProductRevenueHistory partyProductRevenueHistory;

                        if (!partyProductRevenueHistoriesByProduct.TryGetValue(partyProductRevenuesByPeriodByProduct.Key, out partyProductRevenueHistory))
                        {
                            PartyProductRevenue partyProductRevenue = null;
                            foreach (var partyProductRevenuesByPeriod in partyProductRevenuesByPeriodByProduct.Value)
                            {
                                partyProductRevenue = partyProductRevenuesByPeriod.Value;
//.........这里部分代码省略.........
开发者ID:Allors,项目名称:apps,代码行数:101,代码来源:PartyProductRevenueHistories.cs


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