Пример #1
0
 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");
     }
 }
Пример #2
0
 private void detach_Partneris(Partneri entity)
 {
     this.SendPropertyChanging();
     entity.Mjesta = null;
 }
Пример #3
0
 private void attach_Partneris(Partneri entity)
 {
     this.SendPropertyChanging();
     entity.Mjesta = this;
 }
Пример #4
0
 partial void DeletePartneri(Partneri instance);
Пример #5
0
 partial void UpdatePartneri(Partneri instance);
Пример #6
0
 partial void InsertPartneri(Partneri instance);