private void button2_Click(object sender, EventArgs e)
 {
     Encrypt enc = new Encrypt();
     Clan c = new Clan(enc.EncryptString(t_ime.Text + " " + t_prezime.Text), t_jmbg.Text, slika);
     DAL.DAL d = DAL.DAL.Instanca;
     d.kreirajKonekciju("localhost", "kladionica", "root", "");
     DAL.DAL.ClanDAO cd = new DAL.DAL.ClanDAO();
     c.DajIDClana = cd.create(c);
     d.terminirajKonekciju();
     MessageBox.Show("Član uspješno dodan!");
     this.Close();
 }
 private void button1_Click(object sender, EventArgs e)
 {
     DAL.DAL d = DAL.DAL.Instanca;
     d.kreirajKonekciju("localhost", "kladionica", "root", "");
     DAL.DAL.ClanDAO cd = new DAL.DAL.ClanDAO();
     Clan trazeni_clan = cd.getById(Convert.ToInt32(textBox1.Text));
     d.terminirajKonekciju();
     l_ime.Text = trazeni_clan.ImePrezime;
     l_jmbg.Text = trazeni_clan.Jmbg;
     pictureBox1.ImageLocation = trazeni_clan.Picpath;
     groupBox1.Visible = true;
 }
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Encrypt enc = new Encrypt();
         DAL.DAL d = DAL.DAL.Instanca;
         d.kreirajKonekciju("localhost", "kladionica", "root", "");
         DAL.DAL.ClanDAO ud = new DAL.DAL.ClanDAO();
         Clan c = ud.getById(Convert.ToInt32(textBox1.Text));
         d.terminirajKonekciju();
         t_ime.Text = enc.DecryptString(c.ImePrezime);
         t_jmbg.Text = c.Jmbg;
         pictureBox1.ImageLocation = c.Picpath;
         groupBox1.Visible = true;
     }
     catch (Exception r)
     {
         MessageBox.Show(r.Message);
     }
 }