internal String Answer_StudentReviews(StudentReviews studentReviews)
 {
     response  = studentReviews.name + " by " + studentReviews.studentName;
     response += "\n\n" + "Hi My name is " + studentReviews.studentName + ". I graduated in " + studentReviews.yearOfGraduation + ". " + studentReviews.review;
     return(response);
 }
示例#2
0
        private void Suggestions_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (Suggestions.SelectedIndex == -1)
            {
                return;
            }



            try
            {
                Answer.Text = "";
                Type     t   = getClass(Suggestions.SelectedItem.GetType());
                Response res = new Response();
                if (t.ToString().ToLower().Contains("Module".ToLower()))
                {
                    var module = new Module();
                    module      = (Module)Suggestions.SelectedItem;
                    Answer.Text = res.Answer_Module(module);
                }
                else if (t.ToString().ToLower().Contains("CourseOverview".ToLower()))
                {
                    var courseOverview = new CourseOverview();
                    courseOverview = (CourseOverview)Suggestions.SelectedItem;
                    Answer.Text    = res.Answer_CourseOverview(courseOverview);
                }
                else if (t.ToString().ToLower().Contains("Professor".ToLower()))
                {
                    var professor = new Professor();
                    professor   = (Professor)Suggestions.SelectedItem;
                    Answer.Text = res.Answer_Professor(professor);
                }
                else if (t.ToString().ToLower().Contains("Prospect".ToLower()))
                {
                    var prospect = new Prospect();
                    prospect    = (Prospect)Suggestions.SelectedItem;
                    Answer.Text = res.Answer_Prospect(prospect);
                }
                else if (t.ToString().ToLower().Contains("AdmissionDocuments".ToLower()))
                {
                    var admissionDocuments = new AdmissionDocuments();
                    admissionDocuments = (AdmissionDocuments)Suggestions.SelectedItem;
                    Answer.Text        = res.Answer_AdmissionDocuments(admissionDocuments);
                }
                else if (t.ToString().ToLower().Contains("StudentReviews".ToLower()))
                {
                    var studentReviews = new StudentReviews();
                    studentReviews = (StudentReviews)Suggestions.SelectedItem;
                    Answer.Text    = res.Answer_StudentReviews(studentReviews);
                }
                else if (t.ToString().ToLower().Contains("Contact".ToLower()))
                {
                    var contact = new Contact();
                    contact     = (Contact)Suggestions.SelectedItem;
                    Answer.Text = res.Answer_Contact(contact);
                }
                else if (t.ToString().ToLower().Contains("AdmissionRequirement".ToLower()))
                {
                    var admissionRequirement = new AdmissionRequirement();
                    admissionRequirement = (AdmissionRequirement)Suggestions.SelectedItem;
                    Answer.Text          = res.Answer_AdmissionRequirement(admissionRequirement);
                }
            }
            catch (Exception)
            {
                return;
            }
        }