public static BudgetAllowTransferRule CreateBudgetAllowTransferRule(string dataAreaId,
                                                                            string legalEntityId,
                                                                            string budgetTransferRule,
                                                                            string ruleMember,
                                                                            string dimensionAttributeId,
                                                                            global::Microsoft.Dynamics.DataEntities.AccountStructure accountStructures,
                                                                            global::Microsoft.Dynamics.DataEntities.Ledger legalEntities)
        {
            BudgetAllowTransferRule budgetAllowTransferRule = new BudgetAllowTransferRule();

            budgetAllowTransferRule.dataAreaId           = dataAreaId;
            budgetAllowTransferRule.LegalEntityId        = legalEntityId;
            budgetAllowTransferRule.BudgetTransferRule   = budgetTransferRule;
            budgetAllowTransferRule.RuleMember           = ruleMember;
            budgetAllowTransferRule.DimensionAttributeId = dimensionAttributeId;
            if ((accountStructures == null))
            {
                throw new global::System.ArgumentNullException("accountStructures");
            }
            budgetAllowTransferRule.AccountStructures = accountStructures;
            if ((legalEntities == null))
            {
                throw new global::System.ArgumentNullException("legalEntities");
            }
            budgetAllowTransferRule.LegalEntities = legalEntities;
            return(budgetAllowTransferRule);
        }
 partial void OnLedgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntityChanging(global::Microsoft.Dynamics.DataEntities.AccountStructure value);
        public static AdvancedRule CreateAdvancedRule(string accountStructure, string advancedRuleName, global::Microsoft.Dynamics.DataEntities.AdvancedRuleCriterion ledgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity, global::Microsoft.Dynamics.DataEntities.AccountStructure ledgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity)
        {
            AdvancedRule advancedRule = new AdvancedRule();

            advancedRule.AccountStructure = accountStructure;
            advancedRule.AdvancedRuleName = advancedRuleName;
            if ((ledgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity == null))
            {
                throw new global::System.ArgumentNullException("ledgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity");
            }
            advancedRule.LedgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity = ledgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity;
            if ((ledgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity == null))
            {
                throw new global::System.ArgumentNullException("ledgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity");
            }
            advancedRule.LedgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity = ledgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity;
            return(advancedRule);
        }
        public static AccountStructureActivation CreateAccountStructureActivation(string accountStructure, global::Microsoft.Dynamics.DataEntities.AccountStructure ledgerAccountStructureActivationEntity_RelatedRole_LedgerAccountStructureEntity)
        {
            AccountStructureActivation accountStructureActivation = new AccountStructureActivation();

            accountStructureActivation.AccountStructure = accountStructure;
            if ((ledgerAccountStructureActivationEntity_RelatedRole_LedgerAccountStructureEntity == null))
            {
                throw new global::System.ArgumentNullException("ledgerAccountStructureActivationEntity_RelatedRole_LedgerAccountStructureEntity");
            }
            accountStructureActivation.LedgerAccountStructureActivationEntity_RelatedRole_LedgerAccountStructureEntity = ledgerAccountStructureActivationEntity_RelatedRole_LedgerAccountStructureEntity;
            return(accountStructureActivation);
        }
 partial void OnAccountStructuresChanging(global::Microsoft.Dynamics.DataEntities.AccountStructure value);
        public static AccountStructureConstraint CreateAccountStructureConstraint(string accountStructure, int position, global::System.DateTimeOffset activeFrom, global::System.DateTimeOffset activeTo, global::Microsoft.Dynamics.DataEntities.AccountStructure ledgerAccountStructureConstraintEntity_RelatedRole_LedgerAccountStructureEntity)
        {
            AccountStructureConstraint accountStructureConstraint = new AccountStructureConstraint();

            accountStructureConstraint.AccountStructure = accountStructure;
            accountStructureConstraint.Position         = position;
            accountStructureConstraint.ActiveFrom       = activeFrom;
            accountStructureConstraint.ActiveTo         = activeTo;
            if ((ledgerAccountStructureConstraintEntity_RelatedRole_LedgerAccountStructureEntity == null))
            {
                throw new global::System.ArgumentNullException("ledgerAccountStructureConstraintEntity_RelatedRole_LedgerAccountStructureEntity");
            }
            accountStructureConstraint.LedgerAccountStructureConstraintEntity_RelatedRole_LedgerAccountStructureEntity = ledgerAccountStructureConstraintEntity_RelatedRole_LedgerAccountStructureEntity;
            return(accountStructureConstraint);
        }