private void saveButton_Click(object sender, RoutedEventArgs e) { string r; if (roleBox.Text == "Administrator") r = "admin"; else r = "user"; try { using (pisModelDataContext cont = new pisModelDataContext()) { korisnici art = new korisnici { korisnicko_ime = userName.Text, lozinka = Password.Text, ovlast = r }; cont.korisnicis.InsertOnSubmit(art); cont.SubmitChanges(); } updateListBox(); } catch (Exception ex) { MessageBox.Show("Dogodila se pogreška!!!\n" + ex.Message.ToString()); } }
partial void Deletekorisnici(korisnici instance);
partial void Updatekorisnici(korisnici instance);
partial void Insertkorisnici(korisnici instance);