コード例 #1
0
        private void BackBTN_Click(object sender, RoutedEventArgs e)
        {
            ViewStudentOrCourse ad = new ViewStudentOrCourse();

            ad.Show();
            this.Close();
        }
コード例 #2
0
        private void BackBTN_Click(object sender, RoutedEventArgs e)
        {
            //opens next window : admin controls
            ViewStudentOrCourse AdminControls = new ViewStudentOrCourse();

            AdminControls.Show();
            this.Close();
        }
コード例 #3
0
        private void LogIn_txt_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(Username_txt.Text) || string.IsNullOrEmpty(Password_txt.Password))
            {
                MessageBox.Show("Please enter the missing data.");
            }

            else
            {
                string name     = Username_txt.Text;
                string password = Password_txt.Password;

                if (WelcomePage.AllAdminsDictionary.ContainsKey(name))
                {
                    if (WelcomePage.AllAdminsDictionary[name].Password == password)
                    {
                        MessageBox.Show("Logging in..");

                        WelcomePage.AdminLogedIn  = true;
                        WelcomePage.AdminUserName = name;
                        WelcomePage.AdminPassword = password;

                        //opens next window : admin controls
                        ViewStudentOrCourse AdminControls = new ViewStudentOrCourse();
                        AdminControls.Show();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Wrong password.");
                    }
                }
                else
                {
                    MessageBox.Show("Admin does not exist.");
                }
            }
        }