private void DbLogin(object obj) { SqlHelper = new DbHelperSql(ServerName, DbName, DbLoginName, DbLoginPsd); SaveXmlDoc(); if (!SqlHelper.IsConnect) { return; } IsDbLoginFailed = false; BasicInfoView view = new BasicInfoView(); view.ShowDialog(); }
private void MainLogin(object obj) { if (!isLink) { MessageBox.Show("串口未连接", "JW8307A", MessageBoxButton.OK, MessageBoxImage.Asterisk); return; } if (Person.LoginName == MainLoginName && Person.LoginPsd == mainLoginPsd) { IsMainLoginFailed = false; Person.IsBasicInfoViewEnable = true; Person.IsUserSetViewEnable = true; //跳转到数据库登录界面 var view = new DbLoginView(); view.ShowDialog(); } else { Person.SqlHelper = new DbHelperSql(Person.ServerName, Person.DbName, Person.DbLoginName, Person.DbLoginPsd); if (Person.SqlHelper.IsConnect) { IsMainLoginFailed = false; Person.IsBasicInfoViewEnable = false; Person.IsUserSetViewEnable = false; DbLoginViewModel.SqlHelper = Person.SqlHelper; var view = new BasicInfoView(); view.ShowDialog(); } else { MessageBox.Show("数据库登录失败,请联系管理员"); } } }