예제 #1
0
        private void btn_check_Click(object sender, EventArgs e)
        {
            // check is entered string is valid
            if (!string.IsNullOrWhiteSpace(txt_answer.Text))
            {
                ChapooLogic.Employee_Service service = new Employee_Service();
                Employee employee = new Employee();

                employee.username = txt_User.Text;
                string answer;

                //get answer
                answer = service.forgotpass(employee);

                // check if answer matches
                if (txt_answer.Text.ToLower() == answer.ToLower())
                {
                    // if passwords match
                    if (txt_newpass == txt_repeatpass)
                    {
                        //call hashing function
                        HashwithSalt hash = new HashwithSalt();
                        // create salt and create hash
                        string salt   = hash.CreateSalt(64);
                        string hashed = hash.GenerateHash(txt_newpass.Text, salt);
                        //grab and parse username
                        int username = int.Parse(txt_User.Text);

                        // change password
                        service.Alterpass(username, hashed, salt);
                        // show success
                        MessageBox.Show("Je wachtwoord is succesvol veranderd");


                        // open login form again
                        LoginForm loginForm = new LoginForm();
                        loginForm.Show();
                        this.Close();
                    }
                }
                else //display fail if answer is wrong
                {
                    MessageBox.Show("Foutief antwoord op de vraag");
                }
            }
        }
예제 #2
0
        // menu panel area
        private void MenuPanel(string menuItem)
        {
            switch (menuItem)
            {
            case "Betaaloverzicht":
                BetaalOverzicht betaalOverzicht = new BetaalOverzicht(_CurrentEmployee, this);
                timerOber.Stop();
                betaalOverzicht.Show();
                this.Hide();
                break;

            case "KeukenBarOverzicht":
                KeukenBarOverzicht barOverzicht = new KeukenBarOverzicht(_CurrentEmployee, this);
                barOverzicht.Show();
                this.Hide();
                break;

            case "Management":
                Management management = new Management(_CurrentEmployee, this);
                management.Show();
                this.Hide();
                break;

            case "Besteloverzicht":
                BestelOverzicht bestelOverzicht = new BestelOverzicht(_CurrentEmployee, this);
                timerOber.Stop();
                bestelOverzicht.Show();
                this.Hide();
                break;

            case "TafelOverzicht":
                TafelOverzicht tafelOverzicht = new TafelOverzicht(_CurrentEmployee, this);
                timerOber.Stop();
                tafelOverzicht.Show();
                this.Hide();
                break;

            case "Exit":
                this.Hide();
                LoginForm loginForm = new LoginForm();
                loginForm.Show();
                break;
            }
        }
예제 #3
0
        private void btnLogOut_Click(object sender, EventArgs e)
        {
            LoginForm login = new LoginForm();

            login.Show();
        }