Example #1
0
        private void lbSuggestionAnswer_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                string item = lbSuggestionAnswer.SelectedItem.ToString();

                FormQa form = new FormQa(item, "answer");
                switch (form.ShowDialog())
                {
                case DialogResult.OK:
                    txtSolution.Text = GlobalService.SelectedQaItem;
                    break;

                case DialogResult.Ignore:
                    txtSolution.Text = txtSolution.Text + " Ref: ( " + GlobalService.SelectedQaItem + " )";
                    break;

                default: break;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message + ex.StackTrace);
            }
        }
Example #2
0
        private void lbSuggestionQuestion_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                string item = lbSuggestionQuestion.SelectedItem.ToString();

                FormQa form = new FormQa(item, "question");
                switch (form.ShowDialog())
                {
                case DialogResult.OK:
                    txtQuestion.Text = GlobalService.SelectedQaItem;
                    break;

                case DialogResult.Ignore:
                    txtQuestion.Text = txtQuestion.Text + " Ref: ( " + GlobalService.SelectedQaItem + " )";
                    break;

                default: break;
                }

                lbSuggestionAnswer.Items.Clear();

                foreach (QaList qa in GlobalService.QaList)
                {
                    if (txtQuestion.Text != "")
                    {
                        if (qa.Question.ToLower().Contains(GlobalService.SelectedQaItem.ToLower()))
                        {
                            if (!lbSuggestionAnswer.Items.Contains(qa.Answer))
                            {
                                lbSuggestionAnswer.Items.Add(qa.Answer);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message + ex.StackTrace);
            }
        }