using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using CollaborativePlatformProject.CollaborationPlatform.Form; using CollaborativePlatformProject.CollaborationPlatform.Util; namespace CollaborativePlatformProject { /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); this.WindowStartupLocation = WindowStartupLocation.CenterScreen; } /// /// 登陆 /// /// /// private void LoginLayButton_Click(object sender, RoutedEventArgs e) { //获取用户名和密码 string userName = tb_userName.Text; string userPwd = tb_userPwd.Text; //验证登陆 if (LoginUtil.VerifyLoginMethod(userName, userPwd)) { HomepageForm homepageForm = new HomepageForm(); homepageForm.Show(); this.Close(); } else { //登陆事变 MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.None); } } /// /// 注册 /// /// /// private void RegisterLayButton_Click(object sender, RoutedEventArgs e) { } /// /// 临时登陆按下 /// /// /// private void TemporaryLogin_Click(object sender, RoutedEventArgs e) { sp_Login.Visibility = Visibility.Collapsed; sp_Register.Visibility = Visibility.Collapsed; sp_temporaryLogin.Visibility = Visibility.Visible; } /// /// 临时登陆-确定 /// /// /// private void TemporaryLogin2_Click(object sender, RoutedEventArgs e) { List temporaryLogins = new List() { "550632" }; if (!string.IsNullOrEmpty(tb_InvitationCode.Text) && temporaryLogins.Contains(tb_InvitationCode.Text)) { HomepageForm homepageForm = new HomepageForm(); homepageForm.Show(); this.Close(); } else { //登陆事变 MessageBox.Show("邀请码错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.None); } } } }