private void LoginButton_OnClick(object sender, RoutedEventArgs e)
 {
     using (var db = DataEntityBuilder.BuildMmsEntities())
     {
         if (
             db.Admin.Any(
                 admin =>
                 admin.AdminName.Equals(this.UserNameTextBox.Text) &&
                 admin.AdminPassword.Equals(this.PasswordTextBox.Password)))
         {
             Logging.Logger.GetLogger().Info("Successful log in!");
             this.Close();
         }
         else
         {
             this.FaultReason.Content = "登录失败";
             Logging.Logger.GetLogger().Info("Log in fault! No user or wrong password!");
         }
     }
 }
Ejemplo n.º 2
0
 public SubPagebase()
 {
     this.InitializeComponent();
     this.Db          = DataEntityBuilder.BuildMmsEntities();
     this.CurrentPage = 1;
 }