public static RetailServiceCategory CreateRetailServiceCategory(string dataAreaId,
                                                                        string serviceCategory,
                                                                        int salesDate,
                                                                        int localDeliveryDate,
                                                                        global::Microsoft.Dynamics.DataEntities.Warehouse warehouse,
                                                                        global::Microsoft.Dynamics.DataEntities.RetailReplenishmentRule retailReplenishmentRule)
        {
            RetailServiceCategory retailServiceCategory = new RetailServiceCategory();

            retailServiceCategory.dataAreaId        = dataAreaId;
            retailServiceCategory.ServiceCategory   = serviceCategory;
            retailServiceCategory.SalesDate         = salesDate;
            retailServiceCategory.LocalDeliveryDate = localDeliveryDate;
            if ((warehouse == null))
            {
                throw new global::System.ArgumentNullException("warehouse");
            }
            retailServiceCategory.Warehouse = warehouse;
            if ((retailReplenishmentRule == null))
            {
                throw new global::System.ArgumentNullException("retailReplenishmentRule");
            }
            retailServiceCategory.RetailReplenishmentRule = retailReplenishmentRule;
            return(retailServiceCategory);
        }
        public static ReplenishmentRuleLinesV2 CreateReplenishmentRuleLinesV2(string dataAreaId,
                                                                              string replenishmentRule,
                                                                              long relationId,
                                                                              global::System.DateTimeOffset replenishmentHierarchyValidFrom,
                                                                              decimal defaultWeight,
                                                                              decimal percent,
                                                                              global::System.DateTimeOffset replenishmentHierarchyValidTo,
                                                                              decimal weight,
                                                                              decimal defaultPercent,
                                                                              global::Microsoft.Dynamics.DataEntities.RetailReplenishmentRule retailReplenishmentRule,
                                                                              global::Microsoft.Dynamics.DataEntities.OrganizationHierarchyType organizationHierarchyType)
        {
            ReplenishmentRuleLinesV2 replenishmentRuleLinesV2 = new ReplenishmentRuleLinesV2();

            replenishmentRuleLinesV2.dataAreaId        = dataAreaId;
            replenishmentRuleLinesV2.ReplenishmentRule = replenishmentRule;
            replenishmentRuleLinesV2.RelationId        = relationId;
            replenishmentRuleLinesV2.ReplenishmentHierarchyValidFrom = replenishmentHierarchyValidFrom;
            replenishmentRuleLinesV2.DefaultWeight = defaultWeight;
            replenishmentRuleLinesV2.Percent       = percent;
            replenishmentRuleLinesV2.ReplenishmentHierarchyValidTo = replenishmentHierarchyValidTo;
            replenishmentRuleLinesV2.Weight         = weight;
            replenishmentRuleLinesV2.DefaultPercent = defaultPercent;
            if ((retailReplenishmentRule == null))
            {
                throw new global::System.ArgumentNullException("retailReplenishmentRule");
            }
            replenishmentRuleLinesV2.RetailReplenishmentRule = retailReplenishmentRule;
            if ((organizationHierarchyType == null))
            {
                throw new global::System.ArgumentNullException("organizationHierarchyType");
            }
            replenishmentRuleLinesV2.OrganizationHierarchyType = organizationHierarchyType;
            return(replenishmentRuleLinesV2);
        }
 partial void OnRetailReplenishmentRuleChanging(global::Microsoft.Dynamics.DataEntities.RetailReplenishmentRule value);