Example #1
0
        public ActionResult EditReservaion(long id)
        {
            try
            {
                Roomregister  roomregister  = _hotelReservationService.GetRoomRegisterById(id);
                ReservationVm reservationVm = CastToVm(roomregister);

                List <SelectListItem> billingTypes = new List <SelectListItem>();
                billingTypes.Add(new SelectListItem()
                {
                    Text = "Cash", Value = "1"
                });
                billingTypes.Add(new SelectListItem()
                {
                    Text = "Card", Value = "2"
                });

                ViewBag.billingTypes = new SelectList(billingTypes, "Value", "Text", reservationVm.BillingType.ToString());

                IList <Roomtype> roomTypes = _hotelReservationService.LoadAllHotelTypes();
                ViewBag.roomTypes    = new SelectList(roomTypes, "Id", "Name");
                ViewBag.roomTypeList = roomTypes;
                IList <Room> rooms = _hotelReservationService.LoadAllRooms();
                ViewBag.roomList = rooms;

                return(View(reservationVm));
            }
            catch (Exception)
            {
                throw;
            }
        }