Пример #1
0
        public ActionResult Create()
        {
            var roomTypeList     = new SelectList(roomTypeRepository.GetRoomType(string.Empty), "Id", "RoomTypeCode");
            var floorList        = new SelectList(floorRepository.GetFloors(), "Id", "Name");
            var roomFeaturesList = roomFeatureRepository.GetRoomFeatures();

            ViewBag.RoomTypeList     = roomTypeList;
            ViewBag.FloorList        = floorList;
            ViewBag.RoomFeaturesList = roomFeaturesList;

            //Get Max. Room#.
            var maxRoomNo = roomRepository.GetMaxRoomNo();

            RoomVM model = new RoomVM();

            model.RoomNo = Convert.ToString(maxRoomNo + 1);

            return(View(model));
        }
        public ActionResult Arrivals()
        {
            var roomTypeList     = new SelectList(roomTypeRepository.GetRoomType(string.Empty), "Id", "RoomTypeCode").ToList();
            var roomFeaturesList = roomFeatureRepository.GetRoomFeatures();

            var companyList = new SelectList(CompanyRepository.GetCompanyList(), "Id", "CompanyName").ToList();

            ViewBag.CompanyList = companyList;

            ViewBag.RoomTypeList     = roomTypeList;
            ViewBag.RoomFeaturesList = roomFeaturesList;

            #region Record Activity Log
            RecordActivityLog.RecordActivity(Pages.SEARCH_ARRIVALS, "Goes to arrivals page.");
            #endregion

            return(View());
        }
Пример #3
0
        public ActionResult EditBulkReservation(Guid id)
        {
            TempBulkReservationMasterVM model = new TempBulkReservationMasterVM();
            var reservation = reservationRepository.GetTempBulkReservationMasterById(id, LogInManager.LoggedInUserId);

            if (reservation != null)
            {
                model = reservation;

                if (model.ArrivalDate.HasValue)
                {
                    if (model.ArrivalDate.Value.DayOfWeek == DayOfWeek.Friday || model.ArrivalDate.Value.DayOfWeek == DayOfWeek.Saturday)
                    {
                        model.IsWeekEndPrice = true;
                    }
                }

                #region Room Type
                //Get Room Type Details.
                if (model.RoomTypeId.HasValue)
                {
                    var roomType = roomTypeRepository.GetRoomTypeById(model.RoomTypeId.Value).FirstOrDefault();

                    if (roomType != null)
                    {
                        model.RoomTypeCode = roomType.RoomTypeCode;
                    }
                }
                #endregion

                var roomTypeList = new SelectList(roomTypeRepository.GetRoomType(string.Empty), "Id", "RoomTypeCode").ToList();
                var rateTypeList = new SelectList(rateTypeRepository.GetRateType(string.Empty)
                                                  .Select(
                                                      m => new SelectListItem()
                {
                    Value = m.Id.ToString(),
                    Text  = m.RateTypeCode
                }
                                                      ), "Value", "Text").ToList();
                var reservationTypeList = new SelectList(reservationTypeRepository.GetReservationTypes(), "Id", "Name").ToList();

                var marketList = new SelectList(
                    marketRepository.GetMarkets()
                    .Select(
                        m => new SelectListItem()
                {
                    Value = m.Id.ToString(),
                    Text  = !string.IsNullOrWhiteSpace(m.Description) ? m.Description : m.Name
                }
                        ), "Value", "Text").ToList();


                var reservationSourceList = new SelectList(
                    reservationSourceRepository.GetReservationSources()
                    .Select(
                        m => new SelectListItem()
                {
                    Value = m.Id.ToString(),
                    Text  = !string.IsNullOrWhiteSpace(m.Description) ? m.Description : m.Name
                }
                        ), "Value", "Text").ToList();


                var paymentMethodList = paymentMethodRepository.GetPaymentMethods();

                var roomFeaturesList = roomFeatureRepository.GetRoomFeatures();


                var rtcList = new SelectList(rtcRepository.GetRTC(), "Id", "Code").ToList();

                var roomList = new List <SelectListItem>();
                if (model.RoomTypeId.HasValue)
                {
                    roomList = new SelectList(roomRepository.GetRoomDetailsForBulkReservation(model.RoomTypeId.Value, model.Id), "Id", "RoomNo").ToList();
                }


                ViewBag.RateTypeList        = rateTypeList;
                ViewBag.RoomTypeList        = roomTypeList;
                ViewBag.ReservationTypeList = reservationTypeList;

                ViewBag.MarketList            = marketList;
                ViewBag.ReservationSourceList = reservationSourceList;
                ViewBag.PaymentMethodList     = paymentMethodList;
                ViewBag.RoomFeaturesList      = roomFeaturesList;
                ViewBag.RtcList  = rtcList;
                ViewBag.RoomList = roomList;

                double?dblWeekEndPrice = model.Rate;
                if (model.RoomTypeId.HasValue && model.RateCodeId.HasValue)
                {
                    var weekEndPrice = rateRepository.GetWeekEndPrice(model.RoomTypeId.Value, model.RateCodeId.Value).FirstOrDefault();

                    if (weekEndPrice != null)
                    {
                        dblWeekEndPrice = weekEndPrice.Amount;
                    }
                }

                ViewBag.WeekEndPrice = dblWeekEndPrice;

                //Decrypt Credit Card#
                model.CreditCardNo = Utility.Utility.Decrypt(model.CreditCardNo, Utility.Utility.EncryptionKey);

                //Original Credit Card#
                ViewBag.OriginalCreditCardNo = model.CreditCardNo;

                //Mask Credit Card#
                model.CreditCardNo = Utility.Utility.MaskCreditCardNo(model.CreditCardNo);

                return(View(model));
            }

            return(RedirectToAction("BulkReservation"));
        }