public static ConsolidateAccount CreateConsolidateAccount(string consolidationAccountGroup,
                                                                  string chartOfAccounts,
                                                                  string mainAccount,
                                                                  global::Microsoft.Dynamics.DataEntities.ChartOfAccounts ledgerChartOfAccountsEntityRole2,
                                                                  global::Microsoft.Dynamics.DataEntities.MainAccount consolidationMainAccountEntityRole2,
                                                                  global::Microsoft.Dynamics.DataEntities.MainAccount mainAccountEntityRole2)
        {
            ConsolidateAccount consolidateAccount = new ConsolidateAccount();

            consolidateAccount.ConsolidationAccountGroup = consolidationAccountGroup;
            consolidateAccount.ChartOfAccounts           = chartOfAccounts;
            consolidateAccount.MainAccount = mainAccount;
            if ((ledgerChartOfAccountsEntityRole2 == null))
            {
                throw new global::System.ArgumentNullException("ledgerChartOfAccountsEntityRole2");
            }
            consolidateAccount.LedgerChartOfAccountsEntityRole2 = ledgerChartOfAccountsEntityRole2;
            if ((consolidationMainAccountEntityRole2 == null))
            {
                throw new global::System.ArgumentNullException("consolidationMainAccountEntityRole2");
            }
            consolidateAccount.ConsolidationMainAccountEntityRole2 = consolidationMainAccountEntityRole2;
            if ((mainAccountEntityRole2 == null))
            {
                throw new global::System.ArgumentNullException("mainAccountEntityRole2");
            }
            consolidateAccount.MainAccountEntityRole2 = mainAccountEntityRole2;
            return(consolidateAccount);
        }
 partial void OnLedgerChartOfAccountsEntityRoleChanging(global::Microsoft.Dynamics.DataEntities.ChartOfAccounts value);
        public static AccountTranslation CreateAccountTranslation(string mainAccount, string chartOfAccounts, string language, global::Microsoft.Dynamics.DataEntities.ChartOfAccounts ledgerChartOfAccountsEntityRole, global::Microsoft.Dynamics.DataEntities.MainAccount mainAccountEntityRole)
        {
            AccountTranslation accountTranslation = new AccountTranslation();

            accountTranslation.MainAccount     = mainAccount;
            accountTranslation.ChartOfAccounts = chartOfAccounts;
            accountTranslation.Language        = language;
            if ((ledgerChartOfAccountsEntityRole == null))
            {
                throw new global::System.ArgumentNullException("ledgerChartOfAccountsEntityRole");
            }
            accountTranslation.LedgerChartOfAccountsEntityRole = ledgerChartOfAccountsEntityRole;
            if ((mainAccountEntityRole == null))
            {
                throw new global::System.ArgumentNullException("mainAccountEntityRole");
            }
            accountTranslation.MainAccountEntityRole = mainAccountEntityRole;
            return(accountTranslation);
        }
        public static MainAccountTotalAccountInterval CreateMainAccountTotalAccountInterval(string mainAccountId,
                                                                                            string chartOfAccounts,
                                                                                            string fromValue,
                                                                                            string toValue,
                                                                                            global::Microsoft.Dynamics.DataEntities.ChartOfAccounts totalAccountLedgerChartOfAccountsEntityRole,
                                                                                            global::Microsoft.Dynamics.DataEntities.MainAccount totalAccountMainAccountEntityRole)
        {
            MainAccountTotalAccountInterval mainAccountTotalAccountInterval = new MainAccountTotalAccountInterval();

            mainAccountTotalAccountInterval.MainAccountId   = mainAccountId;
            mainAccountTotalAccountInterval.ChartOfAccounts = chartOfAccounts;
            mainAccountTotalAccountInterval.FromValue       = fromValue;
            mainAccountTotalAccountInterval.ToValue         = toValue;
            if ((totalAccountLedgerChartOfAccountsEntityRole == null))
            {
                throw new global::System.ArgumentNullException("totalAccountLedgerChartOfAccountsEntityRole");
            }
            mainAccountTotalAccountInterval.TotalAccountLedgerChartOfAccountsEntityRole = totalAccountLedgerChartOfAccountsEntityRole;
            if ((totalAccountMainAccountEntityRole == null))
            {
                throw new global::System.ArgumentNullException("totalAccountMainAccountEntityRole");
            }
            mainAccountTotalAccountInterval.TotalAccountMainAccountEntityRole = totalAccountMainAccountEntityRole;
            return(mainAccountTotalAccountInterval);
        }