public void Edit(HotelRoom entity)
 {
     if (entity != null)
     {
         using (var context = new HotelTamagotchiDBEntities())
         {
             context.Entry(entity).State = EntityState.Modified;
             context.SaveChanges();
         }
     }
 }
 public void Add(HotelRoom entity)
 {
     if (entity != null)
     {
         using (var context = new HotelTamagotchiDBEntities())
         {
             context.HotelRooms.Add(entity);
             context.SaveChanges();
         }
     }
 }
Пример #3
0
 public void Delete(HotelRoomSize entity)
 {
     if (entity != null)
     {
         using (var context = new HotelTamagotchiDBEntities())
         {
             context.Entry(entity).State = EntityState.Deleted;
             context.SaveChanges();
         }
     }
 }
 public void Add(PlayerUser entity)
 {
     if (entity != null)
     {
         using (var context = new HotelTamagotchiDBEntities())
         {
             context.PlayerUsers.Add(entity);
             context.SaveChanges();
         }
     }
 }
Пример #5
0
 // Extra
 public void SetAllTamagotchiHotelRoomToNull(HotelBooking entity)
 {
     if (entity != null)
     {
         using (var context = new HotelTamagotchiDBEntities())
         {
             foreach (var tamagotchi in entity.Tamagotchis)
             {
                 tamagotchi.HotelBooking         = null;
                 tamagotchi.HotelRoomId          = null;
                 context.Entry(tamagotchi).State = EntityState.Modified;
                 context.SaveChanges();
             }
         }
     }
 }