Esempio n. 1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            string        s    = novSaobracaj.Text;
            korisnik      k    = (comboBox_Korisnik.SelectedItem as korisnik);
            kartica       broj = (comboBox_broj.SelectedItem as kartica);
            tipSaobracaja tip  = (comboBox_saobracaj.SelectedItem as tipSaobracaja);
            saobracaj     novi = new saobracaj();

            novi.idKartice          = k.id;
            novi.ostvareniSaobracaj = int.Parse(s);
            novi.idTipaSaobracaja   = tip.id;
            novi.datum = DateTime.Now;

            try
            {
                db.saobracajs.InsertOnSubmit(novi);
                db.SubmitChanges();
            }
            catch (Exception)
            {
                throw;
            }
            osveziListu();
        }
 partial void UpdatetipSaobracaja(tipSaobracaja instance);
 partial void DeletetipSaobracaja(tipSaobracaja instance);
 partial void InserttipSaobracaja(tipSaobracaja instance);