Welcome.xaml.cs
上传用户:jxqhsy
上传日期:2020-12-31
资源大小:1793k
文件大小:2k
- 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 Welcome : UserControl
- {
- private string SurveyID = "";
- public Welcome()
- {
- InitializeComponent();
- UpdateTheCurrentSurvey();
- }
- private void UpdateTheCurrentSurvey()
- {
- 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;
- if (!e.Result.Equals(""))
- {
- theSurveyList = Global.getList(e.Result);
- foreach (Customer ctm in theSurveyList)
- {
- if (ctm.IsCurrentSurvey=="1")
- {
- this.SurveyName.Content = ctm.Name;
- this.txtContent.Text = ctm.Description;
- this.SurveyID = ctm.ID;
- break;
- }
- }
- }
- else
- {
- this.SurveyName.Content = "No Content";
- this.txtContent.Text = "No Content";
- }
- }
- private void takeSurvey_Click(object sender, RoutedEventArgs e)
- {
- // TODO: 在此添加调用做题页面
- Survey survey = new Survey(this.SurveyID);
- survey.Width = 960;
- survey.Height = 700;
- (Parent as Canvas).Children.Add(survey);
- (Parent as Canvas).Children.Remove(this);
- }
- }
- }