internal static Publish GetPublishById(int PublishID)
{
Publish publish = null;
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_PUBLISH_GET_BY_ID, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter parameter = new SqlParameter(PN_PUBLISH_ID, System.Data.SqlDbType.Int);
parameter.Direction = System.Data.ParameterDirection.Input;
parameter.Value = PublishID;
sqlCommand.Parameters.Add(parameter);
sqlCommand.Connection.Open();
using (SqlDataReader reader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
{
while (reader.Read())
{
if (publish == null)
publish = new Publish();
FillFromReader(publish, reader);
}
reader.Close();
sqlCommand.Connection.Close();
}
}
return publish;
}