Beispiel #1
0
        //internal void ClearCategories()
        //{
        //    Categories.Clear();
        //}

        internal void LoadTopics(IQueryAdapter dbClient)
        {
            Topics.Clear();
            DataTable TopicData = null;

            dbClient.setQuery("SELECT id, title, body, subject, known_issue FROM help_topics");
            TopicData = dbClient.getTable();

            if (TopicData == null)
            {
                return;
            }

            foreach (DataRow Row in TopicData.Rows)
            {
                HelpTopic NewTopic = new HelpTopic(Convert.ToUInt32(Row["id"]), (string)Row["title"], (string)Row["body"], Convert.ToUInt32(Row["subject"]));

                Topics.Add(Convert.ToUInt32(Row["id"]), NewTopic);

                int Importance = int.Parse(Row["known_issue"].ToString());

                if (Importance == 1)
                {
                    KnownIssues.Add(NewTopic);
                }
                else if (Importance == 2)
                {
                    ImportantTopics.Add(NewTopic);
                }
            }
        }
Beispiel #2
0
 internal static ServerMessage SerializeTopic(HelpTopic Topic)
 {
     ServerMessage Top = new ServerMessage(520);
     Top.AppendUInt(Topic.TopicId);
     Top.AppendStringWithBreak(Topic.Body);
     return Top;
 }
Beispiel #3
0
        internal static ServerMessage SerializeTopic(HelpTopic Topic)
        {
            ServerMessage Top = new ServerMessage(520);

            Top.AppendUInt(Topic.TopicId);
            Top.AppendStringWithBreak(Topic.Body);
            return(Top);
        }
Beispiel #4
0
        //internal void ClearCategories()
        //{
        //    Categories.Clear();
        //}
        internal void LoadTopics(IQueryAdapter dbClient)
        {
            Topics.Clear();
            DataTable TopicData = null;

            dbClient.setQuery("SELECT id, title, body, subject, known_issue FROM help_topics");
            TopicData = dbClient.getTable();

            if (TopicData == null)
            {
                return;
            }

            foreach (DataRow Row in TopicData.Rows)
            {
                HelpTopic NewTopic = new HelpTopic(Convert.ToUInt32(Row["id"]), (string)Row["title"], (string)Row["body"], Convert.ToUInt32(Row["subject"]));

                Topics.Add(Convert.ToUInt32(Row["id"]), NewTopic);

                int Importance = int.Parse(Row["known_issue"].ToString());

                if (Importance == 1)
                {
                    KnownIssues.Add(NewTopic);
                }
                else if (Importance == 2)
                {
                    ImportantTopics.Add(NewTopic);
                }
            }
        }