public void UnesiKorisnikPrograma(KorisnikPrograma korisnikPrograma) { try { LavDataClassesDataContext _baza = new LavDataClassesDataContext(konekcioniString); _baza.ResetujBrojac("KorisnikPrograma", "KorisnikProgramaID"); if (korisnikPrograma.Sifra == null) { korisnikPrograma.Sifra = _baza.DajSledeciIdentity("KorisnikPrograma").ToString(); } _baza.KorisnikProgramas.InsertOnSubmit(korisnikPrograma); _baza.SubmitChanges(); } catch (Exception ex) { throw ex; } }
public void IzmeniKorisnikPrograma(KorisnikPrograma korisnikPrograma, KorisnikPrograma korisnikProgramaOrginal) { try { LavDataClassesDataContext _baza = new LavDataClassesDataContext(konekcioniString); _baza.KorisnikProgramas.Attach(korisnikPrograma, korisnikProgramaOrginal); _baza.SubmitChanges(); } catch (Exception ex) { throw ex; } }