Esempio n. 1
0
        private void ForgetBtnClick(object sender, RoutedEventArgs e)
        {
            if (accountText.Text == "" | emailText.Text == "")
            {
                DialogShow.ShowOkDialog("Warning", "Have item empty!");
                return;
            }

            AccountProcess account = new AccountProcess();

            (string password, string errorType) = account.SearchPassword(accountText.Text, emailText.Text);

            if (password != "")
            {
                DialogShow.ShowOkDialog("Your password", password);
            }
            else
            {
                switch (errorType)
                {
                case "NOACCOUNT":
                    DialogShow.ShowOkDialog("Warning", "Your account not found, please register.");
                    break;

                case "ERRORMATCH":
                    DialogShow.ShowOkDialog("Warning", "Your account is not registered by this email.");
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 2
0
        private void LoginBtnClick(object sender, RoutedEventArgs e)
        {
            AccountProcess account = new AccountProcess();

            if (accountText.Text == "" | passwordText.Password == "")
            {
                DialogShow.ShowOkDialog("warning", "Have item empty!");
                return;
            }
            else if (account.Login(accountText.Text, passwordText.Password))
            {
                this.Hide();
                OrderWindow a = new OrderWindow();
                a.ShowDialog();
                this.Close();
            }
            else
            {
                DialogShow.ShowOkDialog("Error", "Not match account or password");
            }
        }
Esempio n. 3
0
        private void RegisterAccountBtnClick(object sender, RoutedEventArgs e)
        {
            Console.WriteLine(passwordText.Password);
            if (accountText.Text == "" | passwordText.Password == "" | passwordConfirmText.Password == "" | emailText.Text == "")
            {
                DialogShow.ShowOkDialog("warning", "Have item empty!");
                return;
            }
            else if (passwordText.Password != passwordConfirmText.Password)
            {
                DialogShow.ShowOkDialog("warning", "Password and Confirm Password not same!");
                return;
            }

            AccountProcess account = new AccountProcess();
            bool           result  = account.Register(accountText.Text, passwordText.Password, emailText.Text);

            if (result == false)
            {
                DialogShow.ShowOkDialog("warning", "Account has already exist!");
                return;
            }
        }