public RoomStatus AddRoomStatus(RoomStatus roomStatus) { var newRoomStatus = new RoomStatus { Id = roomStatus.Id, Status = roomStatus.Status }; context.RoomStatuses.Add(newRoomStatus); context.SaveChanges(); return(newRoomStatus); }
public RoomType AddRoomType(RoomType roomType) { var newRoomType = new RoomType { Id = roomType.Id, Type = roomType.Type }; context.RoomTypes.Add(newRoomType); context.SaveChanges(); return(newRoomType); }
public Payment AddPayment(Payment payment) { Payment newPayment = new Payment { Id = payment.Id, GuestId = payment.GuestId, ReservationId = payment.ReservationId, Amount = payment.Amount, PayTime = payment.PayTime }; context.Payments.Add(newPayment); context.SaveChanges(); return(newPayment); }
public Room AddRoom(Room room) { Room newRoom = new Room() { Id = room.Id, RoomTypeId = room.RoomTypeId, RoomStatusId = room.RoomStatusId, RoomNumber = room.RoomNumber, MaxPerson = room.MaxPerson }; context.Rooms.Add(newRoom); context.SaveChanges(); return(newRoom); }
public Reservation AddReservation(Reservation reservation) { var newReservation = new Reservation { Id = reservation.Id, GuestId = reservation.GuestId, RoomId = reservation.RoomId, ReservationDate = reservation.ReservationDate, CheckInDate = reservation.CheckInDate, CheckOutDate = reservation.CheckOutDate, PersonCount = reservation.PersonCount }; context.Reservations.Add(newReservation); context.SaveChanges(); return(newReservation); }
public Guest AddGuest(Guest guest) { Guest newGuest = new Guest { Id = guest.Id, FirstName = guest.FirstName, LastName = guest.LastName, Email = guest.Email, Phone = guest.Phone, City = guest.City, Country = guest.Country }; context.Guests.Add(newGuest); context.SaveChanges(); return(newGuest); }