internal static Page GetPage(int PageID)
{
Page page = null;
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_PAGE_GET_BY_ID, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter sqlParameter = new SqlParameter(PN_PAGE_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = PageID;
sqlCommand.Parameters.Add(sqlParameter);
sqlCommand.Connection.Open();
using (SqlDataReader reader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
{
while (reader.Read())
{
if (page == null)
page = new Page();
FillFromReader(page, reader);
}
reader.Close();
sqlCommand.Connection.Close();
}
}
return page;
}