AJH.CMS.Core.Data.AttributeDataMapper.GetAttributesByGroupID C# (CSharp) Method

GetAttributesByGroupID() static private method

static private GetAttributesByGroupID ( int groupID, int languageID ) : List
groupID int
languageID int
return List
        internal static List<AJH.CMS.Core.Entities.Attribute> GetAttributesByGroupID(int groupID, int languageID)
        {
            List<AJH.CMS.Core.Entities.Attribute> colAttributes = null;
            AJH.CMS.Core.Entities.Attribute attribute = null;

            using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
            {
                SqlCommand sqlCommand = new SqlCommand(SN_ATTRIBUTE_GET_BY_GROUP_ID, sqlConnection);
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                SqlParameter sqlParameter = null;
                sqlParameter = new SqlParameter(GroupDataMapper.PN_GROUP_ID, System.Data.SqlDbType.Int);
                sqlParameter.Direction = System.Data.ParameterDirection.Input;
                sqlParameter.Value = groupID;
                sqlCommand.Parameters.Add(sqlParameter);

                sqlParameter = new SqlParameter(ECommerceDataMapperBase.PN_ECO_LAN_LAN_ID, System.Data.SqlDbType.Int);
                sqlParameter.Direction = System.Data.ParameterDirection.Input;
                sqlParameter.Value = languageID;
                sqlCommand.Parameters.Add(sqlParameter);

                sqlParameter = new SqlParameter(ECommerceDataMapperBase.PN_MODULE_ID, System.Data.SqlDbType.Int);
                sqlParameter.Direction = System.Data.ParameterDirection.Input;
                sqlParameter.Value = (int)CMSEnums.ECommerceModule.Attribute;
                sqlCommand.Parameters.Add(sqlParameter);

                sqlCommand.Connection.Open();
                using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                {
                    colAttributes = new List<AJH.CMS.Core.Entities.Attribute>();
                    while (sqlDataReader.Read())
                    {
                        attribute = GetAttribute(colAttributes, sqlDataReader);
                        FillFromReader(attribute, sqlDataReader);
                    }

                    sqlDataReader.Close();
                    sqlCommand.Connection.Close();
                }
            }
            return colAttributes;
        }