Beispiel #1
0
        public IActionResult GetCustomerId(int customerId)
        {
            var CustomerBookings = _ibooking.GetAllBookingsWhitCustomerId(customerId);
            var booking          = CustomerBookings.Select(p => new APIGetCustommerBookings()
            {
                CheckoutDate = p.CheckOutDate.ToShortDateString(),
                CheckinDate  = p.CheckinDate.ToShortDateString(),
                Room         = _iroom.GetRoomWhitId(p.RoomId),
                Bed          = _ibed.GetBedWhitId(p.BedId),
                TotalPrice   = p.Totalprice
            });

            return(new ObjectResult(booking));
        }
        public IActionResult Booking(int customerId)
        {
            var customer         = _icustomer.getCustomerById(customerId);
            var CustomerBookings = _ibooking.GetAllBookingsWhitCustomerId(customerId);
            var b = CustomerBookings.Select(p => new BookingViewModel {
                FirstName   = customer.FirstName,
                LastName    = customer.LastName,
                Room        = _iroom.GetRoomWhitId(p.RoomId),
                Bed         = _ibed.GetBedWhitId(p.BedId),
                Totalprice  = p.Totalprice,
                CheckinDate = p.CheckinDate.ToShortDateString(),
                ChekoutDate = p.CheckOutDate.ToShortDateString()
            });



            return(View(b));
        }