ContactUs.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 ContactUs : UserControl
- {
- public ContactUs()
- {
- InitializeComponent();
- }
- private void sub_Click(object sender, RoutedEventArgs e)
- {
- sub.Background = new SolidColorBrush(Colors.Red);
- string name = Name.Text;
- string age = Age.Text;
- string query = Query.Text;
- if (string.IsNullOrEmpty(name))
- {
- System.Windows.Browser.HtmlPage.Window.Alert("must in put");
- return;
- }
- if (string.IsNullOrEmpty(query))
- {
- System.Windows.Browser.HtmlPage.Window.Alert("must in put");
- return;
- }
- if (string.IsNullOrEmpty(age))
- {
- System.Windows.Browser.HtmlPage.Window.Alert("must in put");
- return;
- }
- try
- {
- int.Parse(age);
- }
- catch
- {
- System.Windows.Browser.HtmlPage.Window.Alert("must be anumber");
- return;
- }
- WebServiceProxy.UserManageSoapClient userManageSoapClient = new SFGS.WebServiceProxy.UserManageSoapClient();
- userManageSoapClient.ContactUSAsync(name, age, query);
- userManageSoapClient.ContactUSCompleted += new EventHandler<SFGS.WebServiceProxy.ContactUSCompletedEventArgs>(userMgrSoapClient_ContactUSCompleted);
- }
- private void userMgrSoapClient_ContactUSCompleted(object sender, SFGS.WebServiceProxy.ContactUSCompletedEventArgs e)
- {
- if (e.Result==true)
- {
- System.Windows.Browser.HtmlPage.Window.Alert("save success");
- }
- else
- {
- System.Windows.Browser.HtmlPage.Window.Alert("Error");
- }
- }
- }
- }