Пример #1
0
 private void PrijavaButton_Click(object sender, EventArgs e)
 {
     try
     {
         if ((EmailTextBox.Text != "") && (GesloTextBox.Text != ""))
         {
             bool x = Ena.Prijava(EmailTextBox.Text, GesloTextBox.Text);
             if (x == true)
             {
                 this.Hide();
                 var MainForm = new MainForm();
                 MainForm.Closed += (s, args) => this.Close();
                 MainForm.Show();
             }
             else
             {
                 MessageBox.Show("Email ali geslo ni pravilno");
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Napaka, poskusite ponovno");
     }
 }
Пример #2
0
 private void SpremenitevGeslaButton_Click(object sender, EventArgs e)
 {
     try
     {
         if ((Geslo3TextBox.Text == Geslo4TextBox.Text) && (Geslo3TextBox.Text != ""))
         {
             Ena.PozabljenoGeslo(Email3TextBox.Text, Geslo3TextBox.Text);
         }
         else
         {
             MessageBox.Show("Gesli se ne ujemata");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Napaka, poskusite ponovno");
     }
 }
Пример #3
0
 private void RegistracijaButton_Click(object sender, EventArgs e)
 {
     try
     {
         if ((ImeTextBox.Text != "") && (PriimekTextBox.Text != "") && (Email2TextBox.Text != "") && (Geslo2textBox.Text != ""))
         {
             Ena.Registracija(ImeTextBox.Text, PriimekTextBox.Text, Email2TextBox.Text, Geslo2textBox.Text);
         }
         else
         {
             MessageBox.Show("Vsi podatki morajo biti izpolnjeni");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Napaka, poskusite ponovno");
     }
 }
Пример #4
0
 public void spremeni_Geslo(string a)
 {
     using (NpgsqlConnection con = new NpgsqlConnection("Server=hattie.db.elephantsql.com; User Id=qrallryw;" + "Password=42JSx-SoQO5TfgzavjTAU5Bz2qJli0rN; Database=qrallryw;"))
     {
         con.Open();
         NpgsqlCommand    com    = new NpgsqlCommand("SELECT update_geslo_uporabnika(" + Public.id + ",'" + Ena.CreateMD5(a) + "')", con);
         NpgsqlDataReader reader = com.ExecuteReader();
         while (reader.Read())
         {
         }
         con.Close();
     }
 }
Пример #5
0
        public static bool Registracija(string a, string b, string c, string d)
        {
            bool x = false;

            using (NpgsqlConnection con = new NpgsqlConnection("Server=hattie.db.elephantsql.com; User Id=qrallryw;" + "Password=42JSx-SoQO5TfgzavjTAU5Bz2qJli0rN; Database=qrallryw;"))
            {
                con.Open();
                NpgsqlCommand    com    = new NpgsqlCommand("SELECT add_uporabnik1('" + a + "','" + b + "','" + c + "','" + Ena.CreateMD5(d) + "')", con);
                NpgsqlDataReader reader = com.ExecuteReader();
                while (reader.Read())
                {
                    Public.Change(reader.GetInt32(0));
                    x = true;
                    //comboBox1.Items.Add(ime);
                    //comboBox1.Items.Add(a);
                }
                con.Close();
            }
            return(x);
        }