private void Button_Click(object sender, RoutedEventArgs e)
 {
     Pass pass = new Pass();
    if (pass.checkPass(PassWord.Password) || pass.checkPassMaster(PassWord.Password))
     {
         buttonClose = false;
         if (!buttonClose)
         {
             _edit.Show();
             Close();
         }
     }
     else
     {
         MessageBox.Show("Incorrect Password");
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     Pass pass = new Pass();
     if (pass.checkPassMaster(PassWord.Password))
     {
         SqlCommand cmd = new SqlCommand("spResetStats", new SqlConnection(conString));
         cmd.Connection.Open();
         cmd.ExecuteScalar();
         cmd.Connection.Close();
         this.Close();
         MessageBox.Show("Successfully reset statistics!");
     }
     else
     {
         MessageBox.Show("Incorrect Password");
     }
 }
Ejemplo n.º 3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     Pass pass = new Pass();
     if (pass.checkPass(PassWord.Password) || pass.checkPassMaster(PassWord.Password))
     {
         try
         {
             new Admin().Show();
             buttonClickClose++;
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
     }
     else
     {
         MessageBox.Show("Incorrect Password");
     }
 }
Ejemplo n.º 4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
           
            Pass pass = new Pass();
            if (Convert.ToBoolean(!SU.IsChecked))
            {
                if (pass.checkPass(Current.Password))
                {

                    if (New1.Password == New2.Password)
                    {
                        pass.changePassword(New1.Password);
                        this.Close();
                    }
                }
            }
            else if (Convert.ToBoolean(SU.IsChecked))
            {
                MessageBox.Show(SU.IsChecked.ToString());
                if (pass.checkPassMaster(Current.Password))
                {

                    if (New1.Password == New2.Password)
                    {
                        pass.changeSU(New1.Password);
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("The passwords do not match", "Error");
                    }
                }
                else
                {
                    MessageBox.Show("Current password is incorrect", "Try Again");
                }
            }

        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Pass pass = new Pass();
            if (pass.checkPassMaster(PassWord.Password))
            {
                SqlCommand cmd = new SqlCommand("spDeleteLog", new SqlConnection(conString));
                cmd.Connection.Open();
                cmd.ExecuteScalar();
                cmd.Connection.Close();
                this.Close();
                IEnumerable<Log> delete = (from Log in listOfPeople select Log);

                listOfPeople.DeleteAllOnSubmit(delete);
               // databaseLogging.SubmitChanges();

                logNewPerson();

                MessageBox.Show("Successfully deleted all the contents of Log!");
            }
            else
            {
                MessageBox.Show("Incorrect Password");
            }
        }