internal static List<Category> GetCategorys(int PortalID, int LanguageID)
{
List<Category> colCategorys = null;
Category category = null;
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_CATEGORY_GET_BY_PORTAL_LANGUAGE, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter sqlParameter = null;
sqlParameter = new SqlParameter(PN_CATEGORY_PORTAL_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = PortalID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(PN_CATEGORY_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))
{
colCategorys = new List<Category>();
while (sqlDataReader.Read())
{
category = GetCategory(colCategorys, sqlDataReader);
FillFromReader(category, sqlDataReader);
}
sqlDataReader.Close();
sqlCommand.Connection.Close();
}
}
return colCategorys;
}