Example #1
0
        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!");
            }
        }
Example #2
0
        public ServerMessage SerializeTopic(HelpTopic Topic)
        {
            ServerMessage Message = new ServerMessage(520);

            Message.AppendUInt(Topic.TopicId);
            Message.AppendStringWithBreak(Topic.Body);
            return(Message);
        }
Example #3
0
		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!");
			}
		}
Example #4
0
		public ServerMessage SerializeTopic(HelpTopic Topic)
		{
			ServerMessage Message = new ServerMessage(520);
			Message.AppendUInt(Topic.TopicId);
			Message.AppendStringWithBreak(Topic.Body);
			return Message;
		}