Пример #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 Deletesaobracaj(saobracaj instance);
 partial void Updatesaobracaj(saobracaj instance);
 partial void Insertsaobracaj(saobracaj instance);
 private void detach_saobracajs(saobracaj entity)
 {
     this.SendPropertyChanging();
     entity.kartica = null;
 }
 private void attach_saobracajs(saobracaj entity)
 {
     this.SendPropertyChanging();
     entity.tipSaobracaja = this;
 }