Responses.xaml.cs
上传用户:jxqhsy
上传日期:2020-12-31
资源大小:1793k
文件大小:3k
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Animation;
- using System.Windows.Shapes;
- namespace SFGS
- {
- public partial class Responses : UserControl
- {
- public Responses()
- {
- InitializeComponent();
- }
- public Responses(string SurveyID)
- {
- InitializeComponent();
- UpdateSurveyContent();
- UpdateQuestionOption(SurveyID);
- }
- private void UpdateSurveyContent()
- {
- WebServiceProxy.UserManageSoapClient userManageSoapClient = new SFGS.WebServiceProxy.UserManageSoapClient();
- userManageSoapClient.ReadAllSurveyAsync();
- userManageSoapClient.ReadAllSurveyCompleted += new EventHandler<SFGS.WebServiceProxy.ReadAllSurveyCompletedEventArgs>(userMgrSoapClient_ReadAllSurveyCompleted);
- }
- private void userMgrSoapClient_ReadAllSurveyCompleted(object sender, SFGS.WebServiceProxy.ReadAllSurveyCompletedEventArgs e)
- {
- List<Customer> theSurveyList = new List<Customer>();
- if (!e.Result.Equals(""))
- {
- theSurveyList = Global.getList(e.Result);
- foreach (Customer ctm in theSurveyList)
- {
- if (ctm.IsCurrentSurvey == "1")
- {
- this.title.Text = ctm.Name;
-
- break;
- }
- }
- }
- else
- {
- this.title.Text = "No Content";
-
- }
- }
- private void UpdateQuestionOption(string SurveyID)
- {
- WebServiceProxy.UserManageSoapClient userManageSoapClient = new SFGS.WebServiceProxy.UserManageSoapClient();
- userManageSoapClient.ReadQuestionAsync(SurveyID);
- userManageSoapClient.ReadQuestionCompleted += new EventHandler<SFGS.WebServiceProxy.ReadQuestionCompletedEventArgs>(userMgrSoapClient_ReadQuestionCompleted);
- }
- private void userMgrSoapClient_ReadQuestionCompleted(object sender, SFGS.WebServiceProxy.ReadQuestionCompletedEventArgs e)
- {
- List<QuestionOptioner> theQuestionList;
- if (!e.Result.Equals(""))
- {
- int count = 1;
- theQuestionList = Global.getQuestionList(e.Result);
- foreach (QuestionOptioner qo in theQuestionList)
- {
- Option o = new Option(qo.ID);
- o.SerialNumber = count.ToString();
- o.QuestionName = qo.Text;
- o.OptionA = qo.OptionA;
- o.OptionB = qo.OptionB;
- o.OptionC = qo.OptionC;
- o.OptionD = qo.OptionD;
- this.OptionCanvas.Children.Add(o);
- }
- }
- }
- }
- }