/// <summary> /// 删除答案 /// </summary> private void answerOperation_Click(object sender, RoutedEventArgs e) { V_EmployeeSurveyInformation mation = this.dgQuestion.SelectedItem as V_EmployeeSurveyInformation; foreach (var items in subjectList) { if (items == mation) { T_OA_REQUIREDETAIL tempData = ((Button)sender).DataContext as T_OA_REQUIREDETAIL; if (items.AnswerList.Count > 1) { items.AnswerList.Remove(tempData); _answerIndex--; List <string> code = new List <string>() { "A", "B", "C", "D", "E", "F", "G" }; for (int j = 0; j < items.AnswerList.Count; j++) { items.AnswerList[j].CODE = code[j]; } } } } }
/// <summary> /// 删除题目 /// </summary> private void questionOperation_Click(object sender, RoutedEventArgs e) { { if (subjectList.Count() > 1) { V_EmployeeSurveyInformation data = ((Button)sender).DataContext as V_EmployeeSurveyInformation; if (data != null) { subjectList.Remove(data); // _subjectid--; return; } ShowMessage("error", "ERROR", "ERROR", "", false); } else { CreateNewData(true); } return; } }