Responses.xaml.cs
上传用户:jxqhsy
上传日期:2020-12-31
资源大小:1793k
文件大小:3k
源码类别:

SilverLight

开发平台:

HTML/CSS

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Documents;
  8. using System.Windows.Input;
  9. using System.Windows.Media;
  10. using System.Windows.Media.Animation;
  11. using System.Windows.Shapes;
  12. namespace SFGS
  13. {
  14.     public partial class Responses : UserControl
  15.     {
  16.         public Responses()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.         public Responses(string SurveyID)
  21.         {
  22.             InitializeComponent();
  23.             UpdateSurveyContent();
  24.             UpdateQuestionOption(SurveyID);
  25.         }
  26.         private void UpdateSurveyContent()
  27.         {
  28.             WebServiceProxy.UserManageSoapClient userManageSoapClient = new SFGS.WebServiceProxy.UserManageSoapClient();
  29.             userManageSoapClient.ReadAllSurveyAsync();
  30.             userManageSoapClient.ReadAllSurveyCompleted += new EventHandler<SFGS.WebServiceProxy.ReadAllSurveyCompletedEventArgs>(userMgrSoapClient_ReadAllSurveyCompleted);
  31.         }
  32.         private void userMgrSoapClient_ReadAllSurveyCompleted(object sender, SFGS.WebServiceProxy.ReadAllSurveyCompletedEventArgs e)
  33.         {
  34.             List<Customer> theSurveyList = new List<Customer>();
  35.             if (!e.Result.Equals(""))
  36.             {
  37.                 theSurveyList = Global.getList(e.Result);
  38.                 foreach (Customer ctm in theSurveyList)
  39.                 {
  40.                     if (ctm.IsCurrentSurvey == "1")
  41.                     {
  42.                         this.title.Text = ctm.Name;
  43.                         
  44.                         break;
  45.                     }
  46.                 }
  47.             }
  48.             else
  49.             {
  50.                 this.title.Text = "No Content";
  51.                 
  52.             }
  53.         }
  54.         private void UpdateQuestionOption(string SurveyID)
  55.         {
  56.             WebServiceProxy.UserManageSoapClient userManageSoapClient = new SFGS.WebServiceProxy.UserManageSoapClient();
  57.             userManageSoapClient.ReadQuestionAsync(SurveyID);
  58.             userManageSoapClient.ReadQuestionCompleted += new EventHandler<SFGS.WebServiceProxy.ReadQuestionCompletedEventArgs>(userMgrSoapClient_ReadQuestionCompleted);
  59.         }
  60.         private void userMgrSoapClient_ReadQuestionCompleted(object sender, SFGS.WebServiceProxy.ReadQuestionCompletedEventArgs e)
  61.         {
  62.             List<QuestionOptioner> theQuestionList;
  63.             if (!e.Result.Equals(""))
  64.             {
  65.                 int count = 1;
  66.                 theQuestionList = Global.getQuestionList(e.Result);
  67.                 foreach (QuestionOptioner qo in theQuestionList)
  68.                 {
  69.                     Option o = new Option(qo.ID);
  70.                     o.SerialNumber = count.ToString();
  71.                     o.QuestionName = qo.Text;
  72.                     o.OptionA = qo.OptionA;
  73.                     o.OptionB = qo.OptionB;
  74.                     o.OptionC = qo.OptionC;
  75.                     o.OptionD = qo.OptionD;
  76.                     this.OptionCanvas.Children.Add(o);
  77.                 }
  78.             }
  79.         }
  80.     }
  81. }