private void button_renunt_Click(object sender, EventArgs e)
        {
            this.Hide();
            FrmAutentificare frm = new FrmAutentificare();

            frm.ShowDialog();
            this.Close();
        }
Пример #2
0
        private void deconectareToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            FrmAutentificare frm = new FrmAutentificare();

            frm.ShowDialog();
            this.Close();
        }
        private void button_register_Click(object sender, EventArgs e)
        {
            string nume     = this.textBox_nume.Text;
            string prenume  = this.textBox_prenume.Text;
            string email    = this.textBox_email.Text;
            string parola   = this.textBox_pass.Text;
            string parola2  = this.textBox_pass2.Text;
            string capctcha = this.textBox_cod.Text;

            if (util.emailExists(email) || email.Length == 0)
            {
                this.textBox_email.ResetText();
                MessageBox.Show("Email inlavid!");
            }
            else if (parola.Length < 3)
            {
                this.textBox_pass.ResetText();
                this.textBox_pass2.ResetText();
                MessageBox.Show("Parola prea scurta!");
            }
            else if (parola != parola2)
            {
                this.textBox_pass.ResetText();
                this.textBox_pass2.ResetText();
                MessageBox.Show("Parolele difera");
            }
            else if (cod != (capctcha + ".png"))
            {
                MessageBox.Show(cod);
                MessageBox.Show("Cod captcha diferit!");
                this.textBox_cod.ResetText();
                fillCaptcha();
            }
            else if (util.addUser(nume, prenume, email, parola, 1))
            {
                MessageBox.Show("Intregistrare cu succes");
                this.Hide();
                FrmAutentificare frm = new FrmAutentificare();
                frm.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Eroare");
            }
        }