private void NovoMjesto() { try { Partneri partner = new Partneri(); partner.Naziv = nazivtextBox.Text; partner.TipPoduzeca = tipcmbBox.Text; partner.Adresa = adresatxtBox.Text; var drzava = db.Drzaves.Where(m => m.Naziv.ToString().ToLower() == drzavacmbBox.Text.ToLower()).FirstOrDefault(); var mjesto = db.Mjestas.Where(m => m.Naziv.ToString().ToLower() == mjestocmbBox.Text.ToLower() && m.DrzaveId == drzava.DrzaveId && m.Deleted == false).FirstOrDefault(); partner.MjestaId = mjesto.MjestaId; partner.OIB = oibtxtBox.Text; partner.Telefon = telefontxtBox.Text; partner.Telefaks = fakstxtBox.Text; partner.Email = mailtxtBox.Text; partner.WebStranica = nazivtextBox.Text; partner.Napomena = nazivtextBox.Text; db.Partneris.InsertOnSubmit(partner); db.SubmitChanges(); RefreshAll(); } catch (NullReferenceException) { MessageBox.Show("referenfc"); } }
private void detach_Partneris(Partneri entity) { this.SendPropertyChanging(); entity.Mjesta = null; }
private void attach_Partneris(Partneri entity) { this.SendPropertyChanging(); entity.Mjesta = this; }
partial void DeletePartneri(Partneri instance);
partial void UpdatePartneri(Partneri instance);
partial void InsertPartneri(Partneri instance);