コード例 #1
0
    private void GetReservationParamValues()
    {
        string    strParams = "514,2009";
        DataTable objReservationParm;

        objReservationParm = objBLLLogin.GetReservationParamValues(strParams);
        if (objReservationParm != null)
        {
            if (objReservationParm.Rows.Count > 0)
            {
                ReservationParameters objResParam = new ReservationParameters();
                if (Session["sobjResParam"] != null)
                {
                    objResParam = (ReservationParameters)Session["sobjResParam"];
                }


                for (int i = 0; i <= objReservationParm.Rows.Count - 1; i++)
                {
                    if (objReservationParm.Rows[i]["param_id"].ToString() == "514")
                    {
                        objResParam.NoOfNightLimit = objReservationParm.Rows[i]["option_selected"].ToString();
                    }
                    if (objReservationParm.Rows[i]["param_id"].ToString() == "2009")
                    {
                        objResParam.ChildAgeLimit = objReservationParm.Rows[i]["option_selected"].ToString();
                    }
                }
                Session["sobjResParam"] = objResParam;
            }
        }
    }
コード例 #2
0
        public int GetReservationsCount([FromQuery] ReservationParameters reservationParameters)
        {
            // this method retrieves the count of all reservations in order to support pagination
            var reservationCount = _reservationRepository.GetAllReservationsCount(reservationParameters);

            return(reservationCount);
        }
コード例 #3
0
        public ActionResult ConfirmReservationSubmit(ReservationParameters model)
        {
            model.AcceptTermsAndConditions = (HttpContext.Request.Form["confirm_toc"] != null);

            ReservationParameters reservationContext = ReservationUtils.GetContextReservation();

            Session["PPPUiError"] = null;
            ValidationUtils.ClearModelErrors(ModelState);

            reservationContext = ReservationUtils.MapGuestValues(model, reservationContext);
            // var errors = ValidationUtils.GetGuestViolations(model, reservationContext.MaxOccupancy);
            var errors = new List <RuleViolation>();

            if (!ValidationUtils.ErrorsDetected(ModelState, errors))
            {
                Session["ReservationContext"] = reservationContext;
                var reservationResponse = ExecuteBook(reservationContext);

                if (reservationResponse != null && reservationResponse.Errors == null)
                {
                    OwnerUtils.SetContextToReloadPalett();

                    Session["ReservationNumber"] = reservationResponse.ConfirmReservation.ReservationNumber;
                    Response.Redirect("/owner/Points-Protection-Plan", false);
                    return(null);
                }
                else
                {
                    ModelState.AddModelError("", "We're sorry, but since you began your search, that villa type is no longer available. Please select BACK to begin a new search.");
                }
            }

            return(base.Index());
        }
コード例 #4
0
        public IActionResult GetAllUserReservations([FromQuery] ReservationParameters reservationParameters)
        {
            // this method retrieves all reservations for a specified registered user and supports
            // pagination, filtering and sorting
            var reservationCount = _reservationRepository.GetAllUserReservations(reservationParameters);

            return(Ok(reservationCount.Result));
        }
コード例 #5
0
        public IActionResult GetAllReservations([FromQuery] ReservationParameters reservationParameters)
        {
            // this method retrieves a list of all reservations for a specified hotel manager and supports
            // pagination, filtering and sorting
            var reservations = _reservationRepository.GetAllReservations(reservationParameters);

            return(Ok(reservations));
        }
コード例 #6
0
        public IActionResult GetAllUserReservationsCount([FromQuery] ReservationParameters reservationParameters)
        {
            // this method retrieves the count of all user reservations in order to support pagination for
            // user specific reservations
            var reservationCount = _reservationRepository.GetAllUserReservationsCount(reservationParameters);

            return(Ok(reservationCount.Result));
        }
コード例 #7
0
        public void PPPOwnerWebStats(ReservationParameters reservationContext, bool purchasePPP)
        {
            try
            {
                OwnerWebStatsRequest ownerRequest = new OwnerWebStatsRequest();
                string           cursession       = string.Empty;
                string           ownerID          = string.Empty;
                var              searchtabvalue   = string.Empty;
                BlueGreenContext bgContext        = new BlueGreenContext();

                if (HttpContext.Session != null)
                {
                    cursession = HttpContext.Session.SessionID;
                    ownerID    = bgContext.OwnerId;
                }

                ownerRequest.PPPEligible       = purchasePPP ? "1" : "0";
                ownerRequest.PPPFee            = reservationContext.PPPCost.ToString();
                ownerRequest.ReservationNumber = Session["ReservationNumber"].ToString();
                ownerRequest.Phase             = "3";
                ownerRequest.CreatedBy         = "Web";
                ownerRequest.CreatedDate       = DateTime.Now.Date.ToString("MM/dd/yyyy");

                ownerRequest.SiteID       = "7";
                ownerRequest.WebSessionID = cursession;
                ownerRequest.OwnerID      = ownerID;

                ownerRequest.SearchTab       = "";
                ownerRequest.SearchTabSubVal = "";
                ownerRequest.SearchTabValue  = "";
                ownerRequest.ResortID        = "";
                ownerRequest.BGOUnitType     = "";
                ownerRequest.ProjectNumber   = "";
                ownerRequest.UnitType        = "";

                ownerRequest.CheckInDate  = "";
                ownerRequest.CheckOutDate = "";

                ownerRequest.NumberOfGuests   = "";
                ownerRequest.SumBal           = "";
                ownerRequest.RecordReturnCode = "";
                ownerRequest.ExtendedResort   = "";
                ownerRequest.ExtendedStay     = "";
                ownerRequest.Handycap         = "";
                ownerRequest.QryTime          = "";


                ProfileService profileService = new ProfileService();

                profileService.OwnerWebStats(ownerRequest);
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Unexpected exception calling PPPOwnerWebStats", ex, "reservationcontroller.PPPOwnerWebStats");
            }
        }
コード例 #8
0
        public IEnumerable <Reservation> GetAllReservations(int roomId, ReservationParameters reservationParameters)
        {
            var reservations = _hotelAppContext.Reservations.Where(x => x.RoomId == roomId);

            reservations = FilterReservations(ref reservations, reservationParameters);
            reservations = _sort.ApplySort(reservations, reservationParameters.OrderBy);
            return(PagedList <Reservation> .ToPagedList(reservations,
                                                        reservationParameters.PageNumber,
                                                        reservationParameters.PageSize));
        }
コード例 #9
0
        public async Task <int> GetAllUserReservationsCount(ReservationParameters reservationParameters)
        {
            var  currentUser     = _userResolverService.GetUser();
            var  currentUserName = currentUser.FindFirst(ClaimTypes.NameIdentifier).Value;
            User user            = await _userManager.FindByIdAsync(currentUserName);

            var reservations = _hotelAppContext.Reservations.Where(x => x.RegisteredUserId == user.Id);

            reservations = FilterReservations(ref reservations, reservationParameters);
            reservations = _sort.ApplySort(reservations, reservationParameters.OrderBy);
            return(reservations.Count());
        }
コード例 #10
0
        public int GetAllReservationsCount(ReservationParameters reservationParameters)
        {
            var currentUser   = _userResolverService.GetUser();
            var currentUserId = currentUser.FindFirst(ClaimTypes.NameIdentifier).Value;

            var reservations = _hotelAppContext.HotelUsers.Where(x => x.UserId == currentUserId)
                               .Select(x => _hotelAppContext.Rooms
                                       .Where(y => y.HotelId == x.HotelId))
                               .SelectMany(z => z.SelectMany(y => y.Reservations));

            reservations = FilterReservations(ref reservations, reservationParameters);
            reservations = _sort.ApplySort(reservations, reservationParameters.OrderBy);
            return(reservations.Count());
        }
コード例 #11
0
        public ActionResult ResortPreviewDetails()
        {
            DebugUtils.StartLogEvent("ReservationController.ResortPreviewDetails");

            var model = GetLayoutItem <ResortPreviewDetails>();

            ResortDetails resortDetail = null;


            if (Session["ActiveReservation"] != null)
            {
                Reservation activeReservation = (Reservation)Session["ActiveReservation"];
                resortDetail             = ResortManager.GetResortByProject(activeReservation.ProjectStay);
                model.ActiveReservation  = activeReservation;
                model.HandicapAccessible = false;

                ResortService resortService = new ResortService();
                var           UnitInfo      = resortService.GetUnitInfo(model.ActiveReservation.ProjectStay, model.ActiveReservation.AS400UnitType, model.ActiveReservation.UnitNumber);
                if (UnitInfo != null)
                {
                    model.HandicapAccessible = (UnitInfo.HandicapAccessible == "1");
                }

                Session["ActiveReservation"] = null;
            }
            else
            {
                ReservationParameters reservationContext = ReservationUtils.GetContextReservation();

                if (reservationContext != null)
                {
                    resortDetail            = ResortManager.FindResort(reservationContext.ResortId);
                    model.ActiveReservation = new BGSitecore.Models.ResortService.ReservationsList.Reservation();
                    model.ActiveReservation.AS400UnitType    = reservationContext.UnitType;
                    model.ActiveReservation.ProjectStay      = reservationContext.ProjectNumber.ToString();
                    model.ActiveReservation.CheckInDate      = reservationContext.CheckInDate.ToString("yyyyMMdd");
                    model.ActiveReservation.CheckOutDate     = reservationContext.CheckOutDate.ToString("yyyyMMdd");
                    model.ActiveReservation.ReservationType  = reservationContext.ReservationType;
                    model.ActiveReservation.Points           = reservationContext.PointsRequired.ToString();
                    model.ActiveReservation.MaximumOccupancy = reservationContext.MaxOccupancy.ToString();

                    model.ActiveReservation.Amount = reservationContext.BT_TotalCost;
                    model.HandicapAccessible       = (!string.IsNullOrEmpty(reservationContext.wheelchairaccessible) && (reservationContext.wheelchairaccessible == "1"));
                }
            }
            model.ResortDetail = resortDetail;
            DebugUtils.EndLogEvent("ReservationController.ResortPreviewDetails");

            return(View(model));
        }
コード例 #12
0
        public IEnumerable <Reservation> GetAllReservations(ReservationParameters reservationParameters)
        {
            var currentUser   = _userResolverService.GetUser();
            var currentUserId = currentUser.FindFirst(ClaimTypes.NameIdentifier).Value;

            var reservations = _hotelAppContext.HotelUsers.Where(x => x.UserId == currentUserId)
                               .Select(x => _hotelAppContext.Rooms
                                       .Where(y => y.HotelId == x.HotelId))
                               .SelectMany(z => z.SelectMany(y => y.Reservations));

            reservations = FilterReservations(ref reservations, reservationParameters);
            reservations = _sort.ApplySort(reservations, reservationParameters.OrderBy);
            return(PagedList <Reservation> .ToPagedList(reservations,
                                                        reservationParameters.PageNumber,
                                                        reservationParameters.PageSize));
        }
コード例 #13
0
        void OnGetValue(string json, int status)
        {
            ReservationParameters data = new ReservationParameters();

            data = JsonUtility.FromJson <ReservationParameters>(json);
            if (data.status != 1)
            {
                Debug.LogWarning("没有预约" + data.status);
                return;
            }
            UIMainView.Instance.CreatRoomMessagePanel.CanUserHous = (data.maxReserveTim / 3600);//转化为小时
            UIMainView.Instance.CreatRoomMessagePanel.lTuoGuan[0] = "无";
            UIMainView.Instance.CreatRoomMessagePanel.lTuoGuan[1] = data.playTimeOut1 + "秒";
            UIMainView.Instance.CreatRoomMessagePanel.lTuoGuan[2] = data.playTimeOut2 + "秒";
            UIMainView.Instance.CreatRoomMessagePanel.lTuoGuan[3] = data.playTimeOut3 + "秒";
        }
コード例 #14
0
        public ActionResult BonusTimeReservationSubmit(ReservationParameters model)
        {
            model.AcceptTermsAndConditions = (HttpContext.Request.Form["confirm_toc"] != null);
            ReservationParameters reservationContext = ReservationUtils.GetContextReservation();

            reservationContext.CreditCard_Type = FormatUtils.ConvertCreditCard(model.CreditCard_Type); //Required for the validation
            var listOfError = ValidationUtils.GetCreditCardViolations(model);

            listOfError.AddRange(ValidationUtils.GetAddressViolations(model));
            listOfError.AddRange(ValidationUtils.GetGuestViolations(model, reservationContext.MaxOccupancy));
            Session["ChangedCountry"] = null;
            if (listOfError.Count > 0)
            {
                Session["ChangedCountry"] = model.Address_Country;
                foreach (var vi in listOfError)
                {
                    ModelState.AddModelError("", vi.ErrorMessage);
                }
            }
            else
            {
                reservationContext = ReservationUtils.MapGuestValues(model, reservationContext);
                reservationContext = ReservationUtils.MapAddressValues(model, reservationContext);
                reservationContext = ReservationUtils.MapCreditCardValues(model, reservationContext);

                var reservationResponse = ExecuteBook(reservationContext);
                if (reservationResponse != null && reservationResponse.Errors == null)
                {
                    ReservationUtils.DeleteContextReservation();
                    //Response.Flush();
                    Response.Redirect("/owner/reservation-confirmation?type=Future&reservationNo=" + reservationResponse.ConfirmReservation.ReservationNumber, false);
                    HttpContext.ApplicationInstance.CompleteRequest();
                    return(null);
                }
                else
                {
                    ModelState.AddModelError("", "We're sorry, but since you began your search, that villa type is no longer available. Please select BACK to begin a new search.");
                }
            }

            return(base.Index());
        }
コード例 #15
0
        public ActionResult PointsProtectionPlan()
        {
            var model = GetLayoutItem <PointsProtectionPlan>();

            if (Request.QueryString["reservationNo"] == null)
            {
                ReservationParameters reservationContext = ReservationUtils.GetContextReservation();
                if (reservationContext == null)
                {
                    ReservationUtils.HandelMissingReservationContext();
                }
                else
                {
                    model.payment = reservationContext.PPPCost.ToString();
                    model.points  = reservationContext.PointsRequired;
                }
            }
            else
            {
                //Get the reservation details from service call
                BlueGreenContext bgcontext = new BlueGreenContext();
                var ActiveReservation      = bgcontext.GetActiveReservation(Request.QueryString["reservationNo"], ResortService.RESERVATION_TYPE_FUTURE);
                model.payment = ActiveReservation.PolicyPrice;
                model.points  = FormatUtils.ConvertStringToInt(ActiveReservation.Points);
                Session["ReservationNumber"] = ActiveReservation.ReservationNumber;
                ReservationParameters reservationContext = new ReservationParameters();
                reservationContext.PPPCost        = Convert.ToDecimal(model.payment);
                reservationContext.PointsRequired = FormatUtils.ConvertStringToInt(ActiveReservation.Points);
                Session["ReservationContext"]     = reservationContext;
            }
            if (Session["PPPUiError"] != null)
            {
                var allPreviousError = (List <RuleViolation>)Session["PPPUiError"];
                foreach (RuleViolation item in allPreviousError)
                {
                    ModelState.AddModelError("", item.ErrorMessage);
                }
                Session["PPPUiError"] = null;
            }

            return(View(model));
        }
コード例 #16
0
        // GET: Restaurants/Reservate/5
        public ActionResult Reservate(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            using (var unitOfWork = new UnitOfWork(new RestaurantModelContext()))
            {
                Restaurant restaurant = unitOfWork.Restaurants.Get((int)id);
                if (restaurant == null)
                {
                    return(HttpNotFound());
                }
                ReservationParameters model = new ReservationParameters();
                model.Name = restaurant.NAME;
                model.Id   = restaurant.ID;
                return(View(model));
            }
        }
コード例 #17
0
        public async Task <IActionResult> CreateReservation(ReservationParameters paramss)
        {
            if (ModelState.IsValid)
            {
                var temp = await carService.CreateReservation(paramss);

                if (temp != null)
                {
                    return(Ok(temp));
                }
                else
                {
                    return(BadRequest(new { Message = "Something went wrong. Please, try again later." }));
                }
            }
            else
            {
                return(BadRequest(new { Message = "Invalid parameters supplied." }));
            }
        }
コード例 #18
0
 public ActionResult ShowFreeTables(ReservationParameters model)
 {
     using (UnitOfWork unitOfWork = new UnitOfWork(new RestaurantModelContext()))
     {
         TablesArrangement tablesArrangement = new TablesArrangement();
         tablesArrangement.ReservationParameters = model;
         Dictionary <int, Table> freeTables = unitOfWork.Tables.GetAllFreeTablesForRestaurant(model);
         tablesArrangement.Arrangement = new Dictionary <int, Dictionary <int, Table> >();
         foreach (var item in freeTables)
         {
             if (!tablesArrangement.Arrangement.ContainsKey(item.Value.ROW))
             {
                 tablesArrangement.Arrangement.Add(item.Value.ROW, new Dictionary <int, Table>());
             }
             tablesArrangement.Arrangement[item.Value.ROW][item.Value.COLUMN] = item.Value;
         }
         ViewBag.Title = model.Name;
         return(View(tablesArrangement));
     }
 }
コード例 #19
0
        public Dictionary <int, Table> GetAllFreeTablesForRestaurant(ReservationParameters resParameters)
        {
            IEnumerable <Table> tablesForRes = GetAllTablesForRestaurant(resParameters.Id);
            var result = from reservation in RestaurantModelContext.Reservations
                         join restable in RestaurantModelContext.Resevated_tables
                         on reservation.RE_ID equals restable.RE_ID
                         where
                         reservation.ID.Equals(resParameters.Id) &&
                         (reservation.RE_DATE < DbFunctions.AddHours(resParameters.ReservationTime, resParameters.Duration)) &&
                         (DbFunctions.AddHours(reservation.RE_DATE, reservation.RE_LENGTH) > resParameters.ReservationTime)
                         select new { restable.ID };

            Dictionary <int, Table> tablesForResponse = tablesForRes.ToDictionary(table => table.ID, table => table);

            foreach (var element in result.ToList())
            {
                if (tablesForResponse.ContainsKey(element.ID))
                {
                    tablesForResponse.Remove(element.ID);
                }
            }

            return(tablesForResponse);
        }
コード例 #20
0
        private IQueryable <Reservation> FilterReservations(ref IQueryable <Reservation> reservations, ReservationParameters reservationParameters)
        {
            if (reservationParameters.ReservationStatus != null)
            {
                reservations = reservations.Where(r => r.ReservationStatus.Name == reservationParameters.ReservationStatus);
            }

            return(reservations);
        }
コード例 #21
0
    private void fnROLogin(string lUserEmail)
    {
        Session.Clear();
        Session["sRequestId"]     = null;
        Session["sEditRequestId"] = null;
        //CheckUnderConstruction();
        string strAbsoluteUri = Page.Request.Url.AbsoluteUri.ToString().Replace("loginokta.aspx", "login.aspx") + "?ro=1";

        strAbsoluteUri = ConfigurationManager.AppSettings["idp_sso_target_logouturl"];

        Session["sAbsoluteUrl"] = strAbsoluteUri;
        Session["strTheme"]     = "";
        string strTheme = "";

        if (Request.QueryString["comp"] != null)
        {
            strCompany = Request.QueryString["comp"];
            Session["sAgentCompany"] = strCompany;
            if (strCompany == "924065660726315")
            {
                Session["sDivCode"] = "01";
                strTheme            = "css/" + GetStyleName(strCompany);
            }
            else if (strCompany == "675558760549078")
            {
                Session["sDivCode"] = "02";
                strTheme            = "css/style-style3.css";
            }
            else
            {
                Session["sDivCode"] = "0";
                strTheme            = "css/" + GetStyleName(strCompany);
            }
        }
        else
        {
            strCompany = "924065660726315"; // Default company
            Session["sAgentCompany"] = strCompany;
            Session["sDivCode"]      = "01";
            strTheme = "css/" + GetStyleName(strCompany);
        }
        Session["strTheme"] = strTheme;


        if (Session["sobjResParam"] == null)
        {
            ReservationParameters objResParam = new ReservationParameters();
            objResParam.AbsoluteUrl  = strAbsoluteUri;
            objResParam.AgentCompany = strCompany;
            objResParam.DivCode      = (string)Session["sDivCode"];
            objResParam.CssTheme     = strTheme;
            Session["sobjResParam"]  = objResParam;
        }
        else
        {
            ReservationParameters objResParam = new ReservationParameters();
            objResParam              = (ReservationParameters)Session["sobjResParam"];
            objResParam.AbsoluteUrl  = strAbsoluteUri;
            objResParam.AgentCompany = strCompany;
            objResParam.DivCode      = (string)Session["sDivCode"];
            objResParam.CssTheme     = strTheme;
            Session["sobjResParam"]  = objResParam;
        }

        //LoadLoginPageFields();
        string lUserName;

        lUserName = objclsUtilities.ExecuteQueryReturnStringValue("select top 1 UserCode from usermaster where usemail='" + lUserEmail + "'");
        if (lUserName == null)
        {
            Response.Write("The account is not authorized to login");
            return;
        }
        if (lUserName.Trim() == "")
        {
            Response.Write("The account is not authorized to login");
            return;
        }
        //string lPassword;
        //lPassword = objclsUtilities.ExecuteQueryReturnStringValue("select dbo.pwddecript(userpwd) from usermaster where usercode='" + lUserName + "'");
        //if (1==2) { //(lPassword == null) {
        //    Response.Write("The username is incorrect.");
        //}
        //else
        //{
        if (objBLLLogin.ValidateROUser(lUserName.Trim()) == true)
        {
            Session.Add("sLoginType", "RO");
            ReservationParameters objResParam = new ReservationParameters();
            if (Session["sobjResParam"] != null)
            {
                objResParam = (ReservationParameters)Session["sobjResParam"];
            }
            objResParam.LoginType = "RO";
            Session["sLang"]      = "en-us";
            DataTable objDataTable;
            objDataTable = objBLLLogin.LoadLoginPageSessionFields((string)Session["sAgentCompany"]);
            if (objDataTable.Rows.Count > 0)
            {
                Session.Add("sAgentCode", objDataTable.Rows[0]["agentcode"].ToString());
                Session.Add("sCurrencyCode", objDataTable.Rows[0]["currcode"].ToString());
                Session.Add("sCountryCode", objDataTable.Rows[0]["ctrycode"].ToString());
                Session.Add("GlobalUserName", lUserName.Trim());
                objResParam.AgentCode      = objDataTable.Rows[0]["agentcode"].ToString();
                objResParam.GlobalUserName = lUserName.Trim();
            }
            else
            {
            }

            GetReservationParamValues();

            string LoginIp = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
            objResParam.LoginIp = LoginIp;
            string strIpLocation = "";
            objResParam.LoginIpLocationName = strIpLocation;
            string         strAgentCode      = (string)Session["sAgentCode"].ToString();
            BLLHotelSearch objBLLHotelSearch = new BLLHotelSearch();
            objResParam.Cumulative  = objBLLHotelSearch.FindBookingEnginRateType(strAgentCode).ToString();
            objResParam.WhiteLabel  = objBLLHotelSearch.FindWhiteLabel(strAgentCode).ToString();
            Session["sobjResParam"] = objResParam;

            // objclsUtilities.WriteErrorLog("Redirect Before " & Date.Now)

            Response.Redirect("Home.aspx", false);
        }
        else
        {
            Response.Write("The account is not authorized to login");
        }
        //}
    }
コード例 #22
0
        public async Task <CarReservation> CreateReservation(ReservationParameters paramss)
        {
            var enterprise = await repo2.GetOneEnterprise(paramss.EnterpriseId);

            var car = await repo.GetOneCar(paramss.EnterpriseId, paramss.CarId);

            var specialOfferss = await repo3.GetAllSpecialOffers(paramss.EnterpriseId);


            int numberOfDays = (paramss.DateTo - paramss.DateFrom).Days + 1;

            int price = numberOfDays * car.Price;

            CarReservation retValue = new CarReservation();

            retValue.IsRated            = false;
            retValue.NumberOfDays       = numberOfDays;
            retValue.SelectedCar        = car;
            retValue.SelectedEnterprise = enterprise;
            retValue.DateFrom           = paramss.DateFrom;
            retValue.DateTo             = paramss.DateTo;
            retValue.RentedDay          = paramss.RentedDay;
            List <SpecialOffer> specialOffers = specialOfferss.OrderBy(i => i.NumberOfDays).ToList();

            for (int i = 0; i < specialOffers.Count() - 2; i++)
            {
                if (numberOfDays == specialOffers[i].NumberOfDays)
                {
                    retValue.RealizedPackage = specialOffers[i];
                }

                for (int j = i + 1; j <= specialOffers.Count() - 1; j++)
                {
                    if (numberOfDays > specialOffers[i].NumberOfDays && numberOfDays < specialOffers[j].NumberOfDays)
                    {
                        retValue.RealizedPackage = specialOffers[i];
                    }

                    else if (numberOfDays == specialOffers[j].NumberOfDays)
                    {
                        retValue.RealizedPackage = specialOffers[j];
                    }

                    else if (numberOfDays > specialOffers[i].NumberOfDays && numberOfDays >= specialOffers[j].NumberOfDays)
                    {
                        retValue.RealizedPackage = specialOffers[j];
                    }
                }
            }

            if (retValue.RealizedPackage != null)
            {
                price          = price - ((price * retValue.RealizedPackage.Discount) / 100);
                retValue.Price = price;
            }
            else
            {
                retValue.Price = price;
            }


            return(retValue);
        }
コード例 #23
0
        public ActionResult SubmitPPP(BGSitecore.Models.ReservationParameters model)
        {
            DebugUtils.StartLogEvent("ReservationController.SubmitPPP");

            ReservationParameters reservationContext = ReservationUtils.GetContextReservation();

            model.CreditCard_Type = FormatUtils.ConvertCreditCard(reservationContext.CreditCard_Type);
            if (model.btnSubmit == "action:nocreditcard")
            {
                DeclinePointsProtectionRequest request = new DeclinePointsProtectionRequest();
                request.SiteName          = "";
                request.ReservationNumber = Session["ReservationNumber"].ToString();

                ResortService service           = new ResortService();
                var           response          = service.DeclinePointsProtection(request);
                var           reservationNUmber = Session["ReservationNumber"].ToString();
                PPPOwnerWebStats(reservationContext, false);

                ReservationUtils.DeleteContextReservation();

                Response.Redirect("/owner/reservation-confirmation?bv=true&type=Future&reservationNo=" + reservationNUmber, false);
                return(null);
            }
            else
            {
                var listOfError = ValidationUtils.GetCreditCardViolations(model);
                if (listOfError.Count() <= 0)
                {
                    AcceptPointsProtectionRequest request = new AcceptPointsProtectionRequest();
                    request.SiteName                         = "OnlinePoints";
                    request.ReservationNumber                = Session["ReservationNumber"].ToString();
                    request.Payment                          = new Models.ResortService.AcceptPointsProtection.Payment();
                    request.Payment.CreditCardNumber         = model.CreditCard_Number;
                    request.Payment.CreditCardExpirationDate = ReservationUtils.GetExpDate(model.CreditCard_ExpDateMonth, model.CreditCard_ExpDateYear);
                    request.Payment.CreditCardType           = "V"; // model.CreditCard_Type;
                    request.Payment.CreditCardName           = model.CreditCard_Name;
                    request.Payment.CreditCardAuthorization  = model.CreditCard_VerificationNumber;
                    request.Payment.CreditCardTotal          = Convert.ToString(reservationContext.PPPCost);
                    request.Payment.NonTaxTotal              = "";
                    ResortService service     = new ResortService();
                    var           pppResponse = service.AcceptPointsProtection(request);
                    if (pppResponse == null || pppResponse.Errors != null)
                    {
                        //TODO move this message in sitecore
                        listOfError.Add(new RuleViolation("", "", "Unfortunately, we have encountered a technical error while processing Points Protection Plan.Please call 800.456.CLUB(2582) to report the problem and receive assistance.Thank you."));
                        Session["PPPUiError"] = listOfError;
                    }
                    else
                    {
                        var reservationNUmber = Session["ReservationNumber"].ToString();
                        PPPOwnerWebStats(reservationContext, true);
                        ReservationUtils.DeleteContextReservation();
                        DebugUtils.StartLogEvent("ReservationController.SubmitPPP");

                        Response.Redirect("/owner/reservation-confirmation?bv=true&reservationNo=" + reservationNUmber, false);
                        return(null);
                    }
                }
                else
                {
                    Session["PPPUiError"] = listOfError;
                }
            }

            DebugUtils.StartLogEvent("ReservationController.SubmitPPP");

            return(base.Index());
        }
コード例 #24
0
        public ActionResult SubmitSaveMyPoint(string CCName, string CCNumber, string CVV, string ExpMonth, string ExpYear, string ZipCode, string cctype, bool InternationalZipCode)
        {
            SaveMyPointsResponse response = new SaveMyPointsResponse();

            ReservationParameters model = new ReservationParameters();

            model.CreditCard_ExpDateMonth         = ExpMonth;
            model.CreditCard_ExpDateYear          = ExpYear;
            model.CreditCard_Name                 = CCName;
            model.CreditCard_Number               = CCNumber;
            model.CreditCard_VerificationNumber   = CVV;
            model.CreditCard_ZipCode              = ZipCode;
            model.CreditCard_InternationalZipCode = InternationalZipCode;

            BlueGreenContext bgContext = new BlueGreenContext();

            model.CreditCard_Type = FormatUtils.ConvertCreditCard(cctype);


            var listOfError = ValidationUtils.GetCreditCardViolations(model);

            if (listOfError.Count() <= 0)
            {
                BGSitecore.Models.OwnerService.OwnerSavePointsElectRequest.OwnerSavePointsElectRequest request = new BGSitecore.Models.OwnerService.OwnerSavePointsElectRequest.OwnerSavePointsElectRequest();

                request.Identifier = bgContext.OwnerId;


                request.AgentID = "OWNER";

                request.NameOnCard = model.CreditCard_Name;
                request.Amount     = bgContext.GetSavePointsFee;

                request.CreditCardInfo = new BGSitecore.Models.OwnerService.OwnerSavePointsElectRequest.CreditCardInfo();
                request.CreditCardInfo.CreditCardNumber         = model.CreditCard_Number;
                request.CreditCardInfo.CreditCardExpirationDate = ReservationUtils.GetExpDate(model.CreditCard_ExpDateMonth, model.CreditCard_ExpDateYear);
                request.CreditCardInfo.CreditCardType           = model.CreditCard_Type;
                request.CreditCardInfo.CreditCardCVV            = model.CreditCard_VerificationNumber;

                ProfileService service = new ProfileService();

                var pointResponse = service.OwnerSavePointsElect(request);
                if (pointResponse != null && pointResponse.RetCode == "0")
                {
                    response.RetCode = "0";
                    //TODO move this code
                    bgContext.bxgOwner.AnnualPointsExpiration.SavePointsEligible = false;
                    bgContext.bxgOwner.AnnualPointsExpiration.SavePointsFee      = "0.00";
                    bgContext.bxgOwner.AnnualPointsExpiration.SavePointsMessage  = "";

                    //save owner object with updated annualpoints expiration
                    Session["BXGOwner"]          = bgContext.bxgOwner;
                    response.AuthorizationNumber = pointResponse.AuthorizationNumber;
                    OwnerUtils.SetContextToReloadPalett();
                }
                else
                {
                    response.RetCode = "-1";
                    response.errors  = new List <string>();
                    response.errors.Add("Internal error try again later.");
                }
            }
            else
            {
                response.RetCode = "-1";
                response.errors  = new List <string>();
                foreach (var item in listOfError)
                {
                    response.errors.Add(item.ErrorMessage);
                }

                return(Json(response));
            }

            return(Json(response));
        }
コード例 #25
0
        private BookReservationResponse ExecuteBook(ReservationParameters reservationContext)
        {
            // bool statusExecuteBook = false;
            BlueGreenContext       bgContext = new BlueGreenContext();
            BookReservationRequest request   = new BookReservationRequest();

            request.ReservationProjectNumber = reservationContext.ProjectNumber.ToString();

            request.OwnerID      = reservationContext.OwnerId;
            request.UnitTypeCode = reservationContext.UnitType;


            request.CheckInDate        = reservationContext.CheckInDate.ToString("MM/dd/yyyy");
            request.LengthOfStay       = Convert.ToInt16((reservationContext.CheckOutDate - reservationContext.CheckInDate).TotalDays);
            request.NumberOfAdults     = int.Parse(reservationContext.Guest_NumberOfGuest); //TODO get value from context
            request.AccountNumber      = bgContext.GetPrimaryAccountNumber();
            request.OwnerProjectNumber = bgContext.GetOwnerAccountProject().ToString();

            //Changed to Enclose Special Requests with Special Request for BGO only
            string specialCharacter = Sitecore.Configuration.Settings.GetSetting("IdentifierForSpecialRequestFromBGO");

            request.Comments = (reservationContext.text_SpecialRequests == null) ? "" : specialCharacter + reservationContext.text_SpecialRequests + specialCharacter;

            if (!string.IsNullOrEmpty(reservationContext.wheelchairaccessible) && reservationContext.wheelchairaccessible == "1")
            {
                request.HandicapAccessible = "Y";
                request.Comments           = "REQHANDICAP " + request.Comments;
            }

            if (reservationContext.ReservationType == SearchParameters.RESERVATION_TYPE_BONUSTIME)
            {
                request.ReservationType = "B";
                request.SiteName        = "BonusTime";
            }
            else
            {
                request.ReservationType = "P";
                request.SiteName        = "onlinepoints";
                request.Points          = reservationContext.PointsRequired;
            }
            if (reservationContext.hasCreditcard)
            {
                request.Payment = new Models.ResortService.BookReservationRequest.Payment();
                request.Payment.CreditCardAuthorization  = reservationContext.CreditCard_VerificationNumber;
                request.Payment.CreditCardName           = reservationContext.CreditCard_Name;
                request.Payment.CreditCardNumber         = reservationContext.CreditCard_Number;
                request.Payment.CreditCardType           = FormatUtils.ConvertCreditCard(reservationContext.CreditCard_Type);
                request.Payment.CreditCardExpirationDate = ReservationUtils.GetExpDate(reservationContext.CreditCard_ExpDateMonth, reservationContext.CreditCard_ExpDateYear);
                request.Payment.CreditCardTotal          = Convert.ToDouble(reservationContext.BT_TotalCost);
                request.Payment.NonTaxTotal = Convert.ToDouble(Convert.ToDecimal(reservationContext.DailyPrice) * reservationContext.NumberOfNightChanged);
            }

            if (reservationContext.hasGuest)
            {
                request.Guests = new List <Models.ResortService.BookReservationRequest.Guest>();

                var guestOld = new Models.ResortService.BookReservationRequest.Guest();
                guestOld.GuestType    = "Primary";
                guestOld.GuestID      = "";
                guestOld.FirstName    = reservationContext.Guest_FirstName;
                guestOld.LastName     = reservationContext.Guest_LastName;
                guestOld.Relationship = reservationContext.Guest_Relationship;
                request.Guests.Add(guestOld);


                if (!string.IsNullOrEmpty(reservationContext.Guest_Email))
                {
                    guestOld.EmailAddresses = new List <Models.ResortService.BookReservationRequest.EmailAddress>();
                    var email = new Models.ResortService.BookReservationRequest.EmailAddress();
                    email.AddressType = "Home";
                    email.Email       = reservationContext.Guest_Email;
                    guestOld.EmailAddresses.Add(email);
                }
                else
                {
                    guestOld.EmailAddresses = new List <Models.ResortService.BookReservationRequest.EmailAddress>();
                    var email = new Models.ResortService.BookReservationRequest.EmailAddress();
                    email.AddressType = "Home";
                    email.Email       = bgContext.bxgOwner.Email;
                    guestOld.EmailAddresses.Add(email);
                }

                if (reservationContext.Guest_AddNew != "AddNew")
                {
                    if (!string.IsNullOrEmpty(reservationContext.Guest_PhoneNumber))
                    {
                        guestOld.Phones = new List <Models.ResortService.BookReservationRequest.Phone>();
                        var phone = new Models.ResortService.BookReservationRequest.Phone();
                        phone.PhoneNumberType = "Home";
                        phone.PhoneNumber     = reservationContext.Guest_PhoneNumber;
                        guestOld.Phones.Add(phone);
                    }
                    if (!string.IsNullOrEmpty(reservationContext.Guest_City))
                    {
                        guestOld.Addresses = new List <Models.ResortService.BookReservationRequest.Address>();
                        var address = new Models.ResortService.BookReservationRequest.Address();
                        address.AddressLine1 = " ";
                        address.AddressLine2 = " ";
                        address.CountryCode  = " ";
                        address.PostalCode   = " ";
                        address.AddressType  = "Home";
                        address.City         = reservationContext.Guest_City;

                        // Here I'm assuming that no one will select state without city (they are both required fields anyway)
                        if (!string.IsNullOrEmpty(reservationContext.Guest_State))
                        {
                            address.ProvinceCode = reservationContext.Guest_State;
                        }

                        guestOld.Addresses.Add(address);
                    }
                }
                else
                {
                    var guest = new Models.ResortService.BookReservationRequest.Guest();
                    guest.GuestType    = "GuestOnPrimary";
                    guest.FirstName    = reservationContext.Guest_FirstName;
                    guest.LastName     = reservationContext.Guest_LastName;
                    guest.Relationship = reservationContext.Guest_Relationship;
                    guest.GuestID      = "";
                    if (!string.IsNullOrEmpty(reservationContext.Guest_Email))
                    {
                        guest.EmailAddresses = new List <Models.ResortService.BookReservationRequest.EmailAddress>();
                        var email = new Models.ResortService.BookReservationRequest.EmailAddress();
                        email.AddressType = "Home";

                        email.Email = reservationContext.Guest_Email;
                        guest.EmailAddresses.Add(email);
                    }

                    if (!string.IsNullOrEmpty(reservationContext.Guest_City))
                    {
                        guest.Addresses = new List <Models.ResortService.BookReservationRequest.Address>();
                        var address = new Models.ResortService.BookReservationRequest.Address();
                        address.AddressLine1 = " ";
                        address.AddressLine2 = " ";
                        address.CountryCode  = " ";
                        address.PostalCode   = " ";
                        address.AddressType  = "Home";
                        address.City         = reservationContext.Guest_City;

                        // Here I'm assuming that no one will select state without city (they are both required fields anyway)
                        if (!string.IsNullOrEmpty(reservationContext.Guest_State))
                        {
                            address.ProvinceCode = reservationContext.Guest_State;
                        }

                        guest.Addresses.Add(address);
                    }


                    if (!string.IsNullOrEmpty(reservationContext.Guest_PhoneNumber))
                    {
                        guest.Phones = new List <Models.ResortService.BookReservationRequest.Phone>();
                        var phone = new Models.ResortService.BookReservationRequest.Phone();
                        phone.PhoneNumberType = "Home";
                        phone.PhoneNumber     = reservationContext.Guest_PhoneNumber;
                        guest.Phones.Add(phone);
                    }

                    request.Guests.Add(guest);
                }
            }
            if (reservationContext.hasAddress)
            {
            }

            if (Session["AgentLoginID"] == null)
            {
                request.Agent = "OWNER";
            }
            else
            {
                request.Agent = (string)Session["AgentLoginID"];
            }

            ResortService resortService       = new ResortService();
            var           reservationResponse = resortService.BookReservation(request);

            OwnerWebStats(request, reservationResponse);

            return(reservationResponse);
        }
コード例 #26
0
    private void fnLogin(string lUserEmail)
    {
        //Session.Clear();
        Session["refreshtoken"]   = gs_refreshtoekn;
        Session["accesstoken"]    = gs_accesstoken;
        Session["sRequestId"]     = null;
        Session["sEditRequestId"] = null;
        string strAbsoluteUri = Page.Request.Url.AbsoluteUri.ToString().Replace("loginokta.aspx", "login.aspx");

        strAbsoluteUri = ConfigurationManager.AppSettings["IDP_BaseURL"] + "/accounts/logout/";

        Session["sAbsoluteUrl"] = strAbsoluteUri;
        Session["strTheme"]     = "";
        string strTheme = "";

        if (Request.QueryString["comp"] != null)
        {
            strCompany = Request.QueryString["comp"];
            Session["sAgentCompany"] = strCompany;
            if (strCompany == "924065660726315")
            {
                Session["sDivCode"] = "01";
                strTheme            = "css/" + GetStyleName(strCompany);
            }
            else if (strCompany == "675558760549078")
            {
                Session["sDivCode"] = "02";
                strTheme            = "css/style-style3.css";
            }
            else
            {
                Session["sDivCode"] = "0";
                strTheme            = "css/" + GetStyleName(strCompany);
            }
        }
        else
        {
            strCompany = "924065660726315"; // Default company
            Session["sAgentCompany"] = strCompany;
            Session["sDivCode"]      = "01";
            strTheme = "css/" + GetStyleName(strCompany);
        }
        Session["strTheme"] = strTheme;


        if (Session["sobjResParam"] == null)
        {
            ReservationParameters objResParam = new ReservationParameters();
            objResParam.AbsoluteUrl  = strAbsoluteUri;
            objResParam.AgentCompany = strCompany;
            objResParam.DivCode      = (string)Session["sDivCode"];
            objResParam.CssTheme     = strTheme;
            Session["sobjResParam"]  = objResParam;
        }
        else
        {
            ReservationParameters objResParam = new ReservationParameters();
            objResParam              = (ReservationParameters)Session["sobjResParam"];
            objResParam.AbsoluteUrl  = strAbsoluteUri;
            objResParam.AgentCompany = strCompany;
            objResParam.DivCode      = (string)Session["sDivCode"];
            objResParam.CssTheme     = strTheme;
            Session["sobjResParam"]  = objResParam;
        }

        //LoadLoginPageFields();
        string lUserName;

        lUserName = objclsUtilities.ExecuteQueryReturnStringValue("select top 1 webusername from agentmast (nolock) where isnull(webapprove,0)=1 and webemail='" + lUserEmail + "'");
        string lShortName;

        lShortName = objclsUtilities.ExecuteQueryReturnStringValue("select top 1 ShortName from agentmast (nolock) where isnull(webapprove,0)=1 and webemail='" + lUserEmail + "'");
        if (lUserName == null)
        {
            Response.Write("The account is not authorized to login");
            return;
        }
        if (lUserName.Trim() == "")
        {
            Response.Write("The account is not authorized to login");
            return;
        }
        //string lPassword;
        //lPassword = objclsUtilities.ExecuteQueryReturnStringValue("select dbo.pwddecript(userpwd) from usermaster where usercode='" + lUserName + "'");
        //if (1==2) { //(lPassword == null) {
        //    Response.Write("The username is incorrect.");
        //}
        //else
        //{
        BLLLogin objBLLLogin = new BLLLogin();

        objBLLLogin.UserName  = lUserName;
        objBLLLogin.ShortName = lShortName;
        String LoginIp = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

        objBLLLogin.LoginType = "MAIN";
        objBLLLogin.IpAddress = LoginIp;
        objBLLLogin.DivCode   = (String)Session["sDivCode"];
        DataTable dtValidate;

        dtValidate = objBLLLogin.ValidateUserWithoutPassword();


        if (dtValidate.Rows.Count > 0)
        {
            Session.Add("GlobalUserName", lUserName);
            //Session.Add("Userpwd", txtPassword.Text.Trim);
            Session.Add("changeyear", DateTime.Now.Year.ToString());
            Session.Add("sLoginType", "Agent");

            Session.Add("sAgentCode", dtValidate.Rows[0]["agentcode"].ToString());
            Session.Add("sCurrencyCode", dtValidate.Rows[0]["currcode"].ToString());
            Session.Add("sCountryCode", dtValidate.Rows[0]["ctrycode"].ToString());
            Session["sLang"] = "en-us";

            GetReservationParamValues();


            ReservationParameters objResParam = new ReservationParameters();
            if (Session["sobjResParam"] != null)
            {
                objResParam = (ReservationParameters)Session["sobjResParam"];
            }
            objResParam.LoginIp = LoginIp;
            String strIpLocation = ""; // GeionName = strIpLocation;
            objResParam.AgentCode           = dtValidate.Rows[0]["agentcode"].ToString();
            objResParam.LoginIpLocationName = strIpLocation;
            objResParam.LoginType           = "Agent";


            BLLHotelSearch objBLLHotelSearch = new BLLHotelSearch();
            objResParam.Cumulative = objBLLHotelSearch.FindBookingEnginRateType(dtValidate.Rows[0]["agentcode"].ToString()).ToString();
            objResParam.WhiteLabel = objBLLHotelSearch.FindWhiteLabel(dtValidate.Rows[0]["agentcode"].ToString()).ToString();
            if (dtValidate.Rows[0]["logintype"].ToString() == "subuser")
            {
                objResParam.SubUserCode = dtValidate.Rows[0]["agentsubcode"].ToString();
                objResParam.IsSubUser   = "******";
            }
            else
            {
                objResParam.SubUserCode = "";
                objResParam.IsSubUser   = "******";
            }

            Session["sobjResParam"] = objResParam;
            FormsAuthentication.SetAuthCookie(lUserName, false);
            Session["IDPLOginType"] = "Agent";
            Response.Redirect("Home.aspx", false);
        }
        else
        {
            Response.Write("The account is not authorized to login");
        }
        //}
    }