private void button_Login_Click(object sender, EventArgs e) { string email = this.textBox_email.Text; string parola = this.textBox_parola.Text; if (util.userExists(email, parola)) { GLOBAL.idGLOBAL = util.userid(email, parola); this.Hide(); eLearning1918_Elev frm = new eLearning1918_Elev(); frm.ShowDialog(); this.Close(); } else { this.textBox_email.ResetText(); this.textBox_parola.ResetText(); MessageBox.Show("Eroare Autentificare"); } }
private void btnLogIn_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(constr); SqlDataAdapter sda = new SqlDataAdapter("select count(*) from utilizatori where emailutilizator='" + textBox1.Text + "' and parolautilizator='" + textBox2.Text + "'", con); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { emailElev = textBox1.Text; GenereazaIntrebari(); this.Hide(); eLearning1918_Elev formElev = new eLearning1918_Elev(dtIntrebariGenerate); formElev.Show(); } else { textBox1.Clear(); textBox2.Clear(); MessageBox.Show("Eroare de autentificare!"); } }