Пример #1
0
        private void CreateTopic()
        {
            string topicTitle = tT.Text.Trim();
            string topicDesc  = tD.Text.Trim();
            long   memberId   = Convert.ToInt64(Session["MemberId"]);

            if (topicTitle == string.Empty)
            {
                return;
            }

            long topicId = 0;

            EZDiscuss.Classes.Topic t = new Classes.Topic();

            t.topicTitle       = topicTitle;
            t.topicDescription = topicDesc;
            t.memberId         = memberId;

            topicId = t.TopicCreate();
            if (topicId > 0)
            {
                lM.ForeColor = System.Drawing.Color.Blue;
                lM.Text      = "Topic created successfully.";
            }
            else
            {
                lM.ForeColor = System.Drawing.Color.Red;
                lM.Text      = "Topic was not created unsuccessfully.";
            }
        }
Пример #2
0
        private void LoadMessagesForTopic(long topicId)
        {
            // Display all the messages for this topic in each of the participating members
            Classes.Topic topic = new Classes.Topic();
            DataTable     dt    = topic.TopicsRetrieveMessagesByTopicId(topicId);

            if (dt.Rows.Count > 0)
            {
                rMessages.DataSource = dt;
                rMessages.DataBind();
            }
            else
            {
                // Do nothing for now.
            };
        }
Пример #3
0
        private void CheckTopics()
        {
            // Retrieve member's info from the Login
            DataTable dtMember = (DataTable)Session["memberInfo"];

            if (dtMember != null)
            {
                EZDiscuss.Classes.Topic topics = new Classes.Topic();
                long memberId = Convert.ToInt64(dtMember.Rows[0]["MemberID"]);

                DataTable dt = new DataTable();
                dt = topics.TopicsRetrieveByMemberID(memberId);
                if (dt.Rows.Count > 0)
                {
                    rTopics.DataSource = dt;
                    rTopics.DataBind();
                }
            }
        }