private void register_Click(object sender, EventArgs e)
        {
            int    id   = kraji[comboBox1.SelectedIndex].id;
            string pass = CreateMD5(geslo_text.Text);

            string ualin = "";

            if (IsValidEmail(email_text.Text))
            {
                using (NpgsqlConnection con = new NpgsqlConnection("Server=rogue.db.elephantsql.com; User Id=clhpojwc;" + "Password=wm7N_asXtodPaLSASbaFBEAcB1MtcKMU; Database=clhpojwc;"))
                {
                    con.Open();
                    NpgsqlCommand    com    = new NpgsqlCommand("SELECT registriraj('" + ime_text.Text + "', '" + priimek_text.Text + "', '" + email_text.Text + "', '" + pass + "', " + id + ", '" + tel_text.Text + "')", con);
                    NpgsqlDataReader reader = com.ExecuteReader();
                    while (reader.Read())
                    {
                        ualin = reader.GetString(0);
                    }
                    con.Close();
                }

                if (ualin == "uspesno")
                {
                    MessageBox.Show("Registracija uspesna");

                    this.Hide();

                    PrijavaForm a = new PrijavaForm();

                    a.Show();
                }

                else
                {
                    MessageBox.Show("Registracija neuspesna");
                }
            }

            else
            {
                MessageBox.Show("Email ni validnega formata");
            }
        }
Exemplo n.º 2
0
        private void prijava_but_Click(object sender, EventArgs e)
        {
            PrijavaForm a = new PrijavaForm();

            a.Show();
        }