internal static List<CatalogImage> GetCatalogImagesByCatalogID(int catalogID)
{
List<CatalogImage> colCatalogImages = null;
CatalogImage CatalogImage = null;
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_CATALOG_IMAGE_GET_BY_CATALOG_ID, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter sqlParameter = null;
sqlParameter = new SqlParameter(PN_CATALOG_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = catalogID;
sqlCommand.Parameters.Add(sqlParameter);
sqlCommand.Connection.Open();
using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
{
colCatalogImages = new List<CatalogImage>();
while (sqlDataReader.Read())
{
CatalogImage = GetCatalogImage(colCatalogImages, sqlDataReader);
FillFromReader(CatalogImage, sqlDataReader);
}
sqlDataReader.Close();
sqlCommand.Connection.Close();
}
}
return colCatalogImages;
}