MainWindow.xaml.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using System.Linq;
  2. using System.Text;
  3. using System.Windows;
  4. using System.Windows.Controls;
  5. using System.Windows.Data;
  6. using System.Windows.Documents;
  7. using System.Windows.Input;
  8. using System.Windows.Media;
  9. using System.Windows.Media.Imaging;
  10. using System.Windows.Navigation;
  11. using System.Windows.Shapes;
  12. using CollaborativePlatformProject.CollaborationPlatform.Form;
  13. using CollaborativePlatformProject.CollaborationPlatform.Util;
  14. namespace CollaborativePlatformProject
  15. {
  16. /// <summary>
  17. /// Interaction logic for MainWindow.xaml
  18. /// </summary>
  19. public partial class MainWindow : Window
  20. {
  21. public MainWindow()
  22. {
  23. InitializeComponent();
  24. this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
  25. }
  26. /// <summary>
  27. /// 登陆
  28. /// </summary>
  29. /// <param name="sender"></param>
  30. /// <param name="e"></param>
  31. private void LoginLayButton_Click(object sender, RoutedEventArgs e)
  32. {
  33. //获取用户名和密码
  34. string userName = tb_userName.Text;
  35. string userPwd = tb_userPwd.Text;
  36. //验证登陆
  37. if (LoginUtil.VerifyLoginMethod(userName, userPwd))
  38. {
  39. HomepageForm homepageForm = new HomepageForm();
  40. homepageForm.Show();
  41. this.Close();
  42. }
  43. else
  44. {
  45. //登陆事变
  46. MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.None);
  47. }
  48. }
  49. /// <summary>
  50. /// 注册
  51. /// </summary>
  52. /// <param name="sender"></param>
  53. /// <param name="e"></param>
  54. private void RegisterLayButton_Click(object sender, RoutedEventArgs e)
  55. {
  56. }
  57. /// <summary>
  58. /// 临时登陆按下
  59. /// </summary>
  60. /// <param name="sender"></param>
  61. /// <param name="e"></param>
  62. private void TemporaryLogin_Click(object sender, RoutedEventArgs e)
  63. {
  64. sp_Login.Visibility = Visibility.Collapsed;
  65. sp_Register.Visibility = Visibility.Collapsed;
  66. sp_temporaryLogin.Visibility = Visibility.Visible;
  67. }
  68. /// <summary>
  69. /// 临时登陆-确定
  70. /// </summary>
  71. /// <param name="sender"></param>
  72. /// <param name="e"></param>
  73. private void TemporaryLogin2_Click(object sender, RoutedEventArgs e)
  74. {
  75. List<string> temporaryLogins = new List<string>() { "550632" };
  76. if (!string.IsNullOrEmpty(tb_InvitationCode.Text) && temporaryLogins.Contains(tb_InvitationCode.Text))
  77. {
  78. HomepageForm homepageForm = new HomepageForm();
  79. homepageForm.Show();
  80. this.Close();
  81. }
  82. else
  83. {
  84. //登陆事变
  85. MessageBox.Show("邀请码错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.None);
  86. }
  87. }
  88. }
  89. }