12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- 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
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
- }
- /// <summary>
- /// 登陆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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);
- }
- }
- /// <summary>
- /// 注册
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void RegisterLayButton_Click(object sender, RoutedEventArgs e)
- {
- }
- /// <summary>
- /// 临时登陆按下
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void TemporaryLogin_Click(object sender, RoutedEventArgs e)
- {
- sp_Login.Visibility = Visibility.Collapsed;
- sp_Register.Visibility = Visibility.Collapsed;
- sp_temporaryLogin.Visibility = Visibility.Visible;
- }
- /// <summary>
- /// 临时登陆-确定
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void TemporaryLogin2_Click(object sender, RoutedEventArgs e)
- {
- List<string> temporaryLogins = new List<string>() { "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);
- }
- }
- }
- }
|