internal static List<Module> GetModules(int ParentID)
{
List<Module> colModules = null;
Module module = null;
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_MODULE_GET_BY_PARENT_ID, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter sqlParameter = null;
sqlParameter = new SqlParameter(PN_MODULE_PARENT_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = ParentID;
sqlCommand.Parameters.Add(sqlParameter);
sqlCommand.Connection.Open();
using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
{
colModules = new List<Module>();
while (sqlDataReader.Read())
{
module = GetModule(colModules, sqlDataReader);
FillFromReader(module, sqlDataReader);
}
sqlDataReader.Close();
sqlCommand.Connection.Close();
}
}
return colModules;
}