public MessageBox GetMessageList(string courseId, string section)
 {
     MessageBox messageBox = new MessageBox(courseId, section);
     Message q1 = new Message("ypy", "Is this the question 1?");
     messageBox.addMessage(q1);
     Message q2 = new Message("rv", "Is this the question 2?");
     messageBox.addMessage(q2);
     Message answeredQ1 = new Message("wsf", "Is this answered question 3?");
     answeredQ1.addAnswer(new Answer(AnswerType.Audio, "\\path\\" + answeredQ1.messageId + "\\Q3\\answer.acc"));
     Message answeredQ2 = new Message("tmy", "Is this answered question 4?");
     answeredQ2.addAnswer(new Answer(AnswerType.Text, "This is the answer of Q4"));
     messageBox.addMessage(answeredQ1);
     messageBox.addMessage(answeredQ2);
     return messageBox;
 }
        public MessageBox GetMessageBox(string courseCode, string courseNumber)
        {
            MessageBox messageBox = new MessageBox(courseCode + courseNumber, "");
            QandATableAdapter qaAdapter = new QandATableAdapter();
            CourseTableAdapter courseAdapter = new CourseTableAdapter();
            var courseIdList = courseAdapter.GetIdByCourseDetails(courseCode, Convert.ToInt32(courseNumber));
            int courseId = courseIdList[0].Id;
            var qaTable = qaAdapter.GetMessageListByCourseId(courseId);
            AnswerTypeTableAdapter answerTypeAdapter = new AnswerTypeTableAdapter();
            UserDataTableAdapter userAdapter = new UserDataTableAdapter();
            foreach (var row in qaTable)
            {
                int userId = row.AskedBy;
                string username = userAdapter.GetUserDataById(userId)[0].Username;
                Message message = new Message(username, row.Question);
                message.createTime = row.CreatedTime.ToString("G");
                message.messageId = row.Id;
                try
                {
                    Answer answer = new Answer(row.AnswerType, row.Answer);
                    message.addAnswer(answer);
                }
                catch (StrongTypingException e)
                {

                }
                messageBox.addMessage(message);
            }
            return messageBox;
        }