private void button_signin_Click(object sender, EventArgs e)
        {
            string em      = this.textBox_email.Text;
            string pass    = this.textBox_pass.Text;
            string pass1   = this.textBox_pass1.Text;
            string nume    = this.textBox_nume.Text;
            string prenume = this.textBox_prenume.Text;

            if (em.Trim().Equals("") || pass.Trim().Equals("") || pass1.Trim().Equals("") || nume.Trim().Equals("") || prenume.Trim().Equals(""))
            {
                MessageBox.Show("Campuri incomplete");
            }
            else if (util.emailExists(em))
            {
                MessageBox.Show("Emailul exista deja");
            }
            else if (pass != pass1)
            {
                MessageBox.Show("Parole diferite");
            }
            else if (util.insertUtilizator(em, pass, nume, prenume))
            {
                MessageBox.Show("Iregistrare cu succes");
                this.Hide();
                GLOBAL.emailGlobal = em;
                MeniuFreeBook frmMeniu = new MeniuFreeBook();
                frmMeniu.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Eroare Inregistrare");
            }
        }
示例#2
0
        private void button_Login_Click(object sender, EventArgs e)
        {
            string em   = this.textBox_email.Text;
            string pass = this.textBox_parola.Text;

            if (util.userExists(em, pass))
            {
                this.Hide();
                GLOBAL.emailGlobal = em;
                MeniuFreeBook frmMENIU = new MeniuFreeBook();
                frmMENIU.ShowDialog();
                this.Close();
            }
            else
            {
                this.textBox_email.ResetText();
                this.textBox_parola.ResetText();
                MessageBox.Show("Eroare Autentificare");
            }
        }