コード例 #1
0
        void RegisterCommandExecute(object parameter)
        {
            RegisterWindow rw = new RegisterWindow();

            rw.Owner = Application.Current.MainWindow;
            Application.Current.MainWindow.Hide();
            rw.Show();
        }
コード例 #2
0
        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("无法添加该用户名到系统,请更换用户名");
                }
            }
        }