public void LoadTopics(DatabaseClient dbClient) { Logging.Write("Loading Help Topics.."); this.Topics.Clear(); DataTable dataTable = dbClient.ReadDataTable("SELECT Id, title, body, subject, known_issue FROM help_topics"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { HelpTopic topic = new HelpTopic((uint)dataRow["Id"], (string)dataRow["title"], (string)dataRow["body"], (uint)dataRow["subject"]); this.Topics.Add((uint)dataRow["Id"], topic); int num = int.Parse(dataRow["known_issue"].ToString()); if (num == 1) { this.KnownIssues.Add(topic); } else if (num == 2) { this.ImportantTopics.Add(topic); } } Logging.WriteLine("completed!"); } }
public ServerMessage SerializeTopic(HelpTopic Topic) { ServerMessage Message = new ServerMessage(520); Message.AppendUInt(Topic.TopicId); Message.AppendStringWithBreak(Topic.Body); return(Message); }
public ServerMessage SerializeTopic(HelpTopic Topic) { ServerMessage Message = new ServerMessage(520); Message.AppendUInt(Topic.TopicId); Message.AppendStringWithBreak(Topic.Body); return Message; }