private void Home_Click(object sender, RoutedEventArgs e) { Application app = App.Current; IS3MainWindow mw = app.MainWindow as IS3MainWindow; mw.SwitchToProjectListPage(); }
//登陆验证 private void LoginButton_Click(object sender, RoutedEventArgs e) { XDocument xml = XDocument.Load(Runtime.configurationPath); if ((LoginNameTB.Text == "") || (LoginPasswordTB.Password == "")) { MessageBox.Show("账号或密码不为空"); return; } if ((LoginNameTB.Text != xml.Root.Element("user").Value) || (LoginPasswordTB.Password != xml.Root.Element("password").Value)) { MessageBox.Show("账号或密码错误"); return; } App app = Application.Current as App; IS3MainWindow mw = (IS3MainWindow)app.MainWindow; mw.SwitchToProjectListPage(); }
//登陆验证 private async void LoginButton_Click(object sender, RoutedEventArgs e) { string username = LoginNameTB.Text; string password = LoginPasswordTB.Password; Globals.oAuthClient = new Core.OAuthClient(); string token = await Globals.oAuthClient.Call_WebAPI_By_Resource_Owner_Password_Credentials_Grant(username, password); if (token != string.Empty) { App app = Application.Current as App; IS3MainWindow mw = (IS3MainWindow)app.MainWindow; mw.SwitchToProjectListPage(); } else { MessageBox.Show("账号或密码错误"); } }