fix a copy paste error
This commit is contained in:
parent
34869f1ea9
commit
6d808b7a6e
|
@ -15,13 +15,13 @@ namespace Plattform.DB
|
|||
return ctx.Availabilities.ToList();
|
||||
}
|
||||
}
|
||||
public bool CreateAvailability(Availability city)
|
||||
public bool CreateAvailability(Availability availability)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Availabilities.Add(city);
|
||||
ctx.Availabilities.Add(availability);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
@ -33,14 +33,14 @@ namespace Plattform.DB
|
|||
}
|
||||
}
|
||||
|
||||
public bool UpdateAvailability(Availability city)
|
||||
public bool UpdateAvailability(Availability availability)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Availabilities.Attach(city);
|
||||
ctx.Entry(city).State = System.Data.Entity.EntityState.Modified;
|
||||
ctx.Availabilities.Attach(availability);
|
||||
ctx.Entry(availability).State = System.Data.Entity.EntityState.Modified;
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
@ -52,14 +52,14 @@ namespace Plattform.DB
|
|||
}
|
||||
|
||||
}
|
||||
public bool DeleteAvailability(Availability city)
|
||||
public bool DeleteAvailability(Availability availability)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Availabilities.Attach(city);
|
||||
ctx.Availabilities.Remove(city);
|
||||
ctx.Availabilities.Attach(availability);
|
||||
ctx.Availabilities.Remove(availability);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -15,13 +15,13 @@ namespace Plattform.DB
|
|||
return ctx.Hotels.ToList();
|
||||
}
|
||||
}
|
||||
public bool CreateHotel(Hotel city)
|
||||
public bool CreateHotel(Hotel hotel)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Hotels.Add(city);
|
||||
ctx.Hotels.Add(hotel);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
@ -33,14 +33,14 @@ namespace Plattform.DB
|
|||
}
|
||||
}
|
||||
|
||||
public bool UpdateHotel(Hotel city)
|
||||
public bool UpdateHotel(Hotel hotel)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Hotels.Attach(city);
|
||||
ctx.Entry(city).State = System.Data.Entity.EntityState.Modified;
|
||||
ctx.Hotels.Attach(hotel);
|
||||
ctx.Entry(hotel).State = System.Data.Entity.EntityState.Modified;
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
@ -52,14 +52,14 @@ namespace Plattform.DB
|
|||
}
|
||||
|
||||
}
|
||||
public bool DeleteHotel(Hotel city)
|
||||
public bool DeleteHotel(Hotel hotel)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Hotels.Attach(city);
|
||||
ctx.Hotels.Remove(city);
|
||||
ctx.Hotels.Attach(hotel);
|
||||
ctx.Hotels.Remove(hotel);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -14,13 +14,13 @@ namespace Plattform.DB
|
|||
return ctx.Rooms.ToList();
|
||||
}
|
||||
}
|
||||
public bool CreateRoom(Room city)
|
||||
public bool CreateRoom(Room room)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Rooms.Add(city);
|
||||
ctx.Rooms.Add(room);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
@ -32,14 +32,14 @@ namespace Plattform.DB
|
|||
}
|
||||
}
|
||||
|
||||
public bool UpdateRoom(Room city)
|
||||
public bool UpdateRoom(Room room)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Rooms.Attach(city);
|
||||
ctx.Entry(city).State = System.Data.Entity.EntityState.Modified;
|
||||
ctx.Rooms.Attach(room);
|
||||
ctx.Entry(room).State = System.Data.Entity.EntityState.Modified;
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
@ -51,14 +51,14 @@ namespace Plattform.DB
|
|||
}
|
||||
|
||||
}
|
||||
public bool DeleteRoom(Room city)
|
||||
public bool DeleteRoom(Room room)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.Rooms.Attach(city);
|
||||
ctx.Rooms.Remove(city);
|
||||
ctx.Rooms.Attach(room);
|
||||
ctx.Rooms.Remove(room);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -15,13 +15,13 @@ namespace Plattform.DB
|
|||
return ctx.RoomTypes.ToList();
|
||||
}
|
||||
}
|
||||
public bool CreateRoomType(RoomType city)
|
||||
public bool CreateRoomType(RoomType roomType)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.RoomTypes.Add(city);
|
||||
ctx.RoomTypes.Add(roomType);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
@ -33,14 +33,14 @@ namespace Plattform.DB
|
|||
}
|
||||
}
|
||||
|
||||
public bool UpdateRoomType(RoomType city)
|
||||
public bool UpdateRoomType(RoomType roomType)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.RoomTypes.Attach(city);
|
||||
ctx.Entry(city).State = System.Data.Entity.EntityState.Modified;
|
||||
ctx.RoomTypes.Attach(roomType);
|
||||
ctx.Entry(roomType).State = System.Data.Entity.EntityState.Modified;
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
@ -52,14 +52,14 @@ namespace Plattform.DB
|
|||
}
|
||||
|
||||
}
|
||||
public bool DeleteRoomType(RoomType city)
|
||||
public bool DeleteRoomType(RoomType roomType)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Context ctx = new Context())
|
||||
{
|
||||
ctx.RoomTypes.Attach(city);
|
||||
ctx.RoomTypes.Remove(city);
|
||||
ctx.RoomTypes.Attach(roomType);
|
||||
ctx.RoomTypes.Remove(roomType);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue