private void btnGetAnswer_Click(object sender = null, RoutedEventArgs e = null) { if (this.btnGetAnswer.Opacity == this.ButtonDisable) { return; } string text = this.txtQuestionName.Text; if (text == "") { MessageBox.Show(SurveyMsg.MsgNotFill, SurveyMsg.MsgCaption, MessageBoxButton.OK, MessageBoxImage.Asterisk); this.txtQuestionName.Focus(); return; } string oneCode = new SurveyAnswerDal().GetOneCode(SurveyHelper.SurveyID, text); this.txtAnswer.Text = oneCode; if (this.txtAnswer.Text == "") { this.txtAnswer.Text = "不存在这题答案,将用新增方式保存!"; } this.txtNewAnswer.Text = oneCode; this.txtQuestionName.IsEnabled = false; this.txtQuestionName.Background = new SolidColorBrush(Color.FromRgb(211, 211, 211)); this.txtNewAnswer.IsEnabled = true; this.txtNewAnswer.Background = new SolidColorBrush(Color.FromRgb(byte.MaxValue, byte.MaxValue, byte.MaxValue)); this.btnGetAnswer.Opacity = this.ButtonDisable; this.btnSave.Opacity = this.ButtonEnable; this.btnCancel.Opacity = this.ButtonEnable; this.txtNewAnswer.Focus(); this.txtNewAnswer.SelectAll(); }
private void method_14(int int_0 = 1) { this.TableName = "SurveyAnswer"; SurveyAnswerDal surveyAnswerDal = new SurveyAnswerDal(); if (this.IsFilter) { this.lSurveyAnswer = surveyAnswerDal.GetListBySequenceId(this.FilterSurveyId, SurveyHelper.SurveySequence - 1); } else { string string_ = string.Format("select * from SurveyAnswer where SURVEY_ID ='{0}' and Sequence_id < 80000 order by id", this.FilterSurveyId); this.lSurveyAnswer = surveyAnswerDal.GetListBySql(string_); } if (int_0 == 1) { this.DataGrid1.ItemsSource = this.lSurveyAnswer; return; } if (int_0 == 2) { this.DataGrid2.ItemsSource = this.lSurveyAnswer; return; } if (int_0 == 3) { this.DataGrid3.ItemsSource = this.lSurveyAnswer; } }
private void btnRunAnswer_Click(object sender, RoutedEventArgs e) { string text = this.txtQName.Text.Trim(); if (text == "") { this.txtQAnswer.Text = "(请先输入题号)"; this.txtQName.Focus(); return; } SurveyAnswerDal surveyAnswerDal = new SurveyAnswerDal(); string text2 = "[" + surveyAnswerDal.GetOneCode(SurveyHelper.SurveyID, text) + "]"; if (text2 == "[]") { text2 = "<空> (提醒:题号对大小写敏感)"; } this.txtQAnswer.Text = this.txtQName.Text + " = " + text2; this.txtQName.Focus(); this.txtQName.SelectAll(); }