void RegisterCommandExecute(object parameter) { RegisterWindow rw = new RegisterWindow(); rw.Owner = Application.Current.MainWindow; Application.Current.MainWindow.Hide(); rw.Show(); }
void RegisterNewUserExecute(Object parameter) { RegisterWindow RW_Win = parameter as RegisterWindow; if (RW_Win != null) { SysUserName = RW_Win.txt_UserName.Text.Trim(); SysPwd = RW_Win.txt_Password.Text.Trim(); if (DBInstance.AddNewSystemUser(SysUserName, SysPwd)) { MainWindow MW_Win = RW_Win.Owner as MainWindow; MW_Win.Show(); RW_Win.Close(); } else { MessageBox.Show("无法添加该用户名到系统,请更换用户名"); } } }