Esempio n. 1
0
        private void BtnLogOut_Click(object sender, EventArgs e)
        {
            LogInForm logInForm = new LogInForm();

            this.Hide();
            logInForm.Show();
        }
Esempio n. 2
0
        private void BtnRregister_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(txtUserName.Text))
            {
                MessageBox.Show("Utilizatorul nu este completat", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (String.IsNullOrWhiteSpace(txtPassword.Text))
            {
                MessageBox.Show("Parola nu este completata", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (String.IsNullOrWhiteSpace(txtConfirmPassword.Text))
            {
                MessageBox.Show("Confirmati parola", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            bool   status;
            string userName        = txtUserName.Text;
            string password        = txtPassword.Text;
            string confirmPassword = txtConfirmPassword.Text;

            if (password != confirmPassword)
            {
                MessageBox.Show("Parolele trebuie sa corespunda");
                return;
            }
            BLLogIn bl = new BLLogIn();

            bl.RegisterUser(userName, password, out status);
            if (status == false)
            {
                MessageBox.Show("Utilizatorul exista deja");
                return;
            }

            else
            {
                MessageBox.Show("Utilizatorul inrefistrat cu succes");
                LogInForm logInForm = new LogInForm();
                this.Hide();
                logInForm.Show();
            }
        }