AJH.CMS.Core.Data.HtmlBlockDataMapper.GetHtmlBlocks C# (CSharp) Method

GetHtmlBlocks() static private method

static private GetHtmlBlocks ( int PortalID, int LanguageID ) : List
PortalID int
LanguageID int
return List
        internal static List<HtmlBlock> GetHtmlBlocks(int PortalID, int LanguageID)
        {
            List<HtmlBlock> colHtmlBlocks = null;
            HtmlBlock htmlBlock = null;

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

                SqlParameter sqlParameter = null;

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

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

                sqlCommand.Connection.Open();
                using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                {
                    colHtmlBlocks = new List<HtmlBlock>();
                    while (sqlDataReader.Read())
                    {
                        htmlBlock = GetHtmlBlock(colHtmlBlocks, sqlDataReader);
                        FillFromReader(htmlBlock, sqlDataReader);
                    }

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

Same methods

HtmlBlockDataMapper::GetHtmlBlocks ( ) : List