internal static List<Page> GetPages(int PortalID, int LanguageID)
{
List<Page> colPages = null;
Page page = null;
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_PAGE_GET_BY_PORTAL_LANGUAGE, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter sqlParameter = null;
sqlParameter = new SqlParameter(PN_PAGE_PORTAL_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = PortalID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(PN_PAGE_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))
{
colPages = new List<Page>();
while (sqlDataReader.Read())
{
page = GetPage(colPages, sqlDataReader);
FillFromReader(page, sqlDataReader);
}
sqlDataReader.Close();
sqlCommand.Connection.Close();
}
}
return colPages;
}