Beispiel #1
0
        private void lbSuggestionAnswer_DoubleClick(object sender, EventArgs e)
        {
            if (lbSuggestionAnswer.Items.Count == 0)
            {
                return;
            }

            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);
            }
        }
Beispiel #2
0
        private void lbSuggestionQuestion_DoubleClick(object sender, EventArgs e)
        {
            if (lbSuggestionQuestion.Items.Count == 0)
            {
                return;
            }

            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;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message + ex.StackTrace);
            }
            //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);
             *      }
             *  }
             * }*/
        }