private void BtPotvrdi_Click(object sender, RoutedEventArgs e) { if (!String.IsNullOrEmpty(txtSifra.Text) && !String.IsNullOrEmpty(txtVlasnik.Text) && !String.IsNullOrEmpty(txtKvadratura.Text) && !String.IsNullOrEmpty(cmbKatOpstine.Text) && lbParcele.SelectedValue != null) { Objekti objekti = new Objekti() { IDObjekta = (int.Parse)(txtSifra.Text), Vlasnik = txtVlasnik.Text, Kvadratura = int.Parse(txtKvadratura.Text), Uknjizeno = (bool)ckUknjizeno.IsChecked, IDParcele = (int.Parse)(((Parcele)lbParcele.SelectedValue).IDParcele.ToString()), IDKatOpstina = (int.Parse)(((KatastarskeOpstine)cmbKatOpstine.SelectedValue).IDKatOpstina.ToString()), }; katastar.Objektis.InsertOnSubmit(objekti); try { katastar.SubmitChanges(); MessageBox.Show("Uspesno dodat novi unos", "Obavestenje", MessageBoxButton.OK, MessageBoxImage.Information); Odustani(); } catch (Exception ex) { MessageBox.Show("Nije dodas novi unos " + ex.Message); } } else { MessageBox.Show("Polja ne smeju biti prazna", "Obavestenje", MessageBoxButton.OK, MessageBoxImage.Information); } }
private void detach_Objektis(Objekti entity) { this.SendPropertyChanging(); entity.Parcele = null; }
private void attach_Objektis(Objekti entity) { this.SendPropertyChanging(); entity.Parcele = this; }
partial void DeleteObjekti(Objekti instance);
partial void UpdateObjekti(Objekti instance);
partial void InsertObjekti(Objekti instance);
private void detach_Objektis(Objekti entity) { this.SendPropertyChanging(); entity.KatastarskeOpstine = null; }