Пример #1
0
        private void BtnBack_Click(object sender, EventArgs e)
        {
            MainMenuForm menu = new MainMenuForm();

            menu.Show();
            this.Hide();
        }
Пример #2
0
        private void BtnLogin_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;
            }

            BLLogin   bl   = new BLLogin();
            UserModel user = bl.CheckUser(txtUserName.Text, txtPassword.Text, out bool status);

            if (status)
            {
                MainMenuForm mainMenu = new MainMenuForm();
                mainMenu.UserId = user.UserId;
                mainMenu.Show();
                this.Hide();
                mainMenu.FormClosed += MainMenu_FormClosed;
            }
            else
            {
                MessageBox.Show("Utilizator sau parola incorecta", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void Button1_Click(object sender, EventArgs e)
        {
            MainMenuForm main = new MainMenuForm();

            this.Hide();
            main.Show();
        }
        private void BtnBack_Click(object sender, EventArgs e)
        {
            MainMenuForm mmf = new MainMenuForm();

            mmf.Show();
            this.Hide();
            mmf.FormClosed += Mmf_FormClosed;
        }
        private void BtnMainMenu_Click(object sender, EventArgs e)
        {
            MainMenuForm mainMenu = new MainMenuForm();

            mainMenu.Show();
            this.Hide();
            mainMenu.FormClosed += MainMenu_FormClosed;
        }
Пример #6
0
        private void BtnCreateUser_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(txtUserName.Text))
            {
                MessageBox.Show("Utilizator necompletat", "EROARE", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            if (String.IsNullOrWhiteSpace(txtPassword.Text))
            {
                MessageBox.Show("Parola necompletata", "EROARE", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            string    userName = txtUserName.Text;
            string    password = txtPassword.Text;
            BLLogin   blLogin  = new BLLogin();
            UserModel user     = new UserModel();

            blLogin.InsertUser(userName, password, out bool status, out string error);
            if (status)//userul nu s-a inserat
            {
                MessageBox.Show(error, "EROARE", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            else//userul s-a inserat
            {
                MessageBox.Show(error, "SUCCES!", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                MainMenuForm mainMenu = new MainMenuForm();
                mainMenu.Show();
                this.Hide();
                mainMenu.FormClosed += MainMenu_FormClosed;
                return;
            }
        }
Пример #7
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(txtUserName.Text))
            {
                MessageBox.Show("Utilizator necompletat", "EROARE", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            if (String.IsNullOrWhiteSpace(txtPassword.Text))
            {
                MessageBox.Show("Parola necompletata", "EROARE", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            string    userName = txtUserName.Text;
            string    password = txtPassword.Text;
            BLLogin   blLogin  = new BLLogin();
            UserModel user     = new UserModel();

            user = blLogin.CheckUser(userName, password, out bool status, out string errorMessage);

            if (status)//s-a gasit userul
            {
                MainMenuForm mainMenu = new MainMenuForm();
                mainMenu.Show();
                this.Hide();
                mainMenu.FormClosed += MainMenu_FormClosed;
                UserId = user.UserId;
            }
            else
            {
                MessageBox.Show(errorMessage, "EROARE", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
        }