示例#1
0
 public int UbaciFilm(Film f)
 {
     try
     {
         db.Filmovi.Add(f);
         db.SaveChanges();
         return(f.FilmId);
     }
     catch (Exception)
     {
         db.Entry(f).State = EntityState.Detached;
         return(-1);
     }
 }
示例#2
0
 public int UbaciIznajmljivanje(Iznajmljivanje iz)
 {
     try
     {
         db.Iznajmljivanja.Add(iz);
         db.SaveChanges();
         return(iz.IznajmljivanjeId);
     }
     catch (Exception)
     {
         db.Entry(iz).State = EntityState.Detached;
         return(-1);
     }
 }
示例#3
0
 public int UbaciClana(Clan c)
 {
     try
     {
         db.Clanovi.Add(c);
         db.SaveChanges();
         return(c.ClanId);
     }
     catch (Exception)
     {
         db.Entry(c).State = EntityState.Detached;
         return(-1);
     }
 }