Exemple #1
0
        private GLAccountList DataPortal_Fetch(int accountTypeID, int entityTypeID, int?glAccountID)
        {
            bool cancel = false;

            if (cancel)
            {
                return(null);
            }

            // Fetch Child objects.
            using (var connection = new SqlConnection(ADOHelper.ConnectionString))
            {
                connection.Open();
                using (var command = new SqlCommand("[dbo].[spCFM_GLAccountTypeAndEntityType_Validate]", connection))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    command.Parameters.AddWithValue("@p_GLAccountTypeID", accountTypeID);
                    command.Parameters.AddWithValue("@p_GLEntityTypeID", entityTypeID);

                    if (glAccountID.HasValue)
                    {
                        command.Parameters.AddWithValue("@p_GLAccountID", glAccountID.Value);
                    }

                    using (var reader = command.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            var rowParser = reader.GetRowParser <GLAccount>();
                            do
                            {
                                this.Add(GLAccount.GetGLAccount(rowParser, reader));
                            } while (reader.Read());
                        }
                        return(this);
                    }
                }
            }
        }
Exemple #2
0
 protected void UpdateChildren(GLAccount parent, SqlConnection connection, SqlTransaction trans)
 {
 }
Exemple #3
0
        /// <summary>
        /// Creates a new object of type <see cref="GLAccount"/>.
        /// </summary>
        /// <returns>Returns a newly instantiated collection of type <see cref="GLAccount"/>.</returns>
        public static GLAccount NewGLAccount()
        {
            GLAccount obj = new GLAccount();

            return(obj);
        }