private void Btn_Odustani_Click(object sender, EventArgs e) { this.Close(); Form Prijava = new Prijava(); Prijava.Show(); }
private void Btn_Odjava_Click(object sender, EventArgs e) { Form Prijava = new Prijava(); Prijava.Show(); this.Hide(); }
private void Btn_Odjava_Click(object sender, EventArgs e) { PrijavaKorisnika.ImePrijavljenog = null; Form Prijava = new Prijava(); Prijava.Show(); this.Hide(); }
private void Registriraj_Click(object sender, EventArgs e) { var con = DataBase.GetSqlkonekcija(); con.Open(); SqlCommand Uzmi = new SqlCommand("SELECT COUNT(*) FROM [Registracija] WHERE Email=@email", con); Uzmi.Parameters.AddWithValue("@email", tb_EmailReg.Text); object R = Uzmi.ExecuteScalar(); int Registracija = Convert.ToInt32(R); if (tb_ImeReg.Text == "" || tb_PrezimeReg.Text == "" || tb_EmailReg.Text == "" || tb_LozinkaReg.Text == "" || tb_PotvrdaLoz.Text == "") { Form PopunitePolja = new PopunitePolja(); PopunitePolja.Show(); } else if (tb_LozinkaReg.Text != tb_PotvrdaLoz.Text) { Form LozinkePodudarati = new LozinkePodudarati(); LozinkePodudarati.ShowDialog(); } else if (Registracija > 0) { Form EmailPostoji = new EmailPostoji(); EmailPostoji.Show(); } else { string query = "INSERT INTO Registracija(Ime, Prezime, Email, Lozinka) VALUES " + "('" + tb_ImeReg.Text + "', '" + tb_PrezimeReg.Text + "', '" + tb_EmailReg.Text + "', '" + tb_LozinkaReg.Text + "')"; SqlCommand sqlcomm = new SqlCommand(query, con); sqlcomm.ExecuteNonQuery(); this.Hide(); Form Prijava = new Prijava(); Prijava.Show(); Form UspjesnoRegistriran = new UspjesnoRegistriran(); UspjesnoRegistriran.Show(); } con.Close(); }