/// <summary>
        ///
        /// </summary>
        /// <param name="stateId"></param>
        /// <param name="bookingId">It will be available after cancel previous progress booking i.e CancelRewardPointProgressBooking()</param>
        /// <param name="uniqueSessionId"></param>
        /// <returns></returns>
        public ActionResult ChargeCard(int?stateId, int?bookingId, string uniqueSessionId)
        {
            var propDetails = new PropDetailsM();

            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    var user = BL_WebsiteUser.GetSingleRecordById(User.Identity.GetUserId <long>());
                    if (!user.StateId.HasValue)
                    {
                        user.StateId = stateId;
                        Task.Run(() => BL_WebsiteUser.UpdateRecord(user));
                    }

                    if (Session[uniqueSessionId] != null)
                    {
                        int bookingIdForPayament = 0;

                        propDetails = Session[uniqueSessionId] as PropDetailsM;

                        if (bookingId.HasValue)
                        {
                            bookingIdForPayament = bookingId.Value;
                        }
                        else
                        {
                            bookingIdForPayament = SaveBookingAndGetBookingId(propDetails);
                        }

                        string message      = string.Empty;
                        long   oldBookingId = 0L;

                        var eligibleToMakePayament = BL_WebsiteUser.CheckIfEligibleToMakePayamentUsingRewardPoint(bookingIdForPayament, user.Id, out message, out oldBookingId);

                        if (!eligibleToMakePayament)
                        {
                            return(Json(new { status = true, bookingInProgress = true, oldBookingId = oldBookingId, bookingIdForPayament = bookingIdForPayament, message = message }, JsonRequestBehavior.AllowGet));
                        }

                        return(Json(new { status = true, bookingIdForPayament = bookingIdForPayament }, JsonRequestBehavior.AllowGet));
                    }
                }
            }
            catch (Exception)
            {
                return(Json(new { status = false, message = "Sorry! An error occurred while processing your request, Kindly try after some time." }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { status = false, message = "Sorry! An error occurred while processing your booking, Kindly try after some time." }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public ActionResult Index(PropSearchRequestModel model)
        {
            string type = "";

            if (HttpContext.Request.Params["type"] != null && HttpContext.Request.Params["type"] != "")
            {
                type = HttpContext.Request.Params["type"];
            }
            ViewBag.type = type == "" ? null : type;

            eBiddingSearch obj = new eBiddingSearch();

            if (User.Identity.IsAuthenticated)
            {
                var user = BL_WebsiteUser.GetSingleRecordById(User.Identity.GetUserId <long>());
                obj.sUserTitle     = user.Title;
                obj.sUserFirstName = user.FirstName;
                obj.sUserLastName  = user.LastName;
                obj.sUserEmail     = user.Email;
                obj.sUserMobileNo  = user.PhoneNumber;
                obj.iStateId       = user.StateId.HasValue? user.StateId.Value:0;
            }

            obj.sSearchId            = Convert.ToInt32(model.cid);
            obj.sSearchName          = model.cname;
            obj.sSearchType          = model.ctype == "City" ? "C" : model.ctype == "Locality" ? "L" : "A";
            obj.ctype                = model.ctype;
            obj.sJsonRoomData        = model.sRoomData;
            obj.sCheckIn             = model.sCheckIn;
            obj.sCheckOut            = model.sCheckOut;
            obj.cname                = model.cname;
            obj.type                 = ViewBag.type;
            obj.CountryCodePhoneList = BL_Country.GetAllCountryPhoneCodes();
            List <etblIndianLocalityCordinate> cordinatesList;

            var list = BL_Bidding.GetAreaLocalityForBid(obj.sSearchType, obj.sSearchId, out cordinatesList);

            obj.lstPolygonData = cordinatesList;

            obj.sJsonLocality          = OneFineRateAppUtil.clsUtils.ConvertToJson(list);
            obj.BidSearchData          = "BidSearchData" + Guid.NewGuid().ToString();
            obj.BidData                = "BidData" + Guid.NewGuid().ToString();
            Session[obj.BidSearchData] = obj;
            Session[obj.BidData]       = model;
            //TempData.Keep();
            return(View(obj));
        }
        public ActionResult Review(string propId, int roomId, string checkIn, string checkOut, int ratePlanId, string sRoomData, bool isPromo, string uniqueSessionId)
        {
            try
            {
                ViewBag.HeaderBarData = "Preview";

                var decodedPropId = Convert.ToInt32(clsUtils.Decode(propId));
                var customerId    = User.Identity.GetUserId <long>();

                DateTime dtCheckIn  = DateTime.ParseExact(checkIn, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                DateTime dtCheckOut = DateTime.ParseExact(checkOut, "dd/MM/yyyy", CultureInfo.InvariantCulture);

                #region RoomOccupancySearch

                DataTable dtRoomOccupancySearch = new DataTable();
                dtRoomOccupancySearch.Columns.AddRange(new DataColumn[3]
                {
                    new DataColumn("ID", typeof(int)),
                    new DataColumn("iAdults", typeof(short)),
                    new DataColumn("children", typeof(short))
                });

                DataTable dtChildrenAgeSearch = new DataTable();
                dtChildrenAgeSearch.Columns.AddRange(new DataColumn[2]
                {
                    new DataColumn("ID", typeof(int)),
                    new DataColumn("Age", typeof(short))
                });

                var roomDataResult = new List <RoomData>();

                if (!string.IsNullOrEmpty(sRoomData))
                {
                    roomDataResult = new JavaScriptSerializer().Deserialize <List <RoomData> >(sRoomData);

                    foreach (var room in roomDataResult)
                    {
                        DataRow roomOccupancy = dtRoomOccupancySearch.NewRow();
                        roomOccupancy["ID"]       = room.room;
                        roomOccupancy["iAdults"]  = room.adult;
                        roomOccupancy["children"] = room.child;
                        dtRoomOccupancySearch.Rows.Add(roomOccupancy);

                        foreach (var child in room.ChildAge)
                        {
                            DataRow dtChildrenAge = dtChildrenAgeSearch.NewRow();
                            dtChildrenAge["ID"] = room.room;
                            if (child.Age == "<1")
                            {
                                dtChildrenAge["Age"] = "0";
                                child.Age            = "0";
                            }
                            else
                            {
                                dtChildrenAge["Age"] = child.Age;
                            }
                            dtChildrenAge["Age"] = child.Age == "<1" ? "0" : child.Age;

                            dtChildrenAgeSearch.Rows.Add(dtChildrenAge);
                        }
                    }
                }

                #endregion

                #region Hotel Details

                var propDetails = BL_PropDetails.GetRoomReviewDetailsToRedeemPoints(decodedPropId,
                                                                                    customerId,
                                                                                    dtCheckIn.ToString("yyyy-MM-dd"),
                                                                                    dtCheckOut.ToString("yyyy-MM-dd"),
                                                                                    CurrencyCode,
                                                                                    roomId,
                                                                                    ratePlanId,
                                                                                    isPromo,
                                                                                    dtRoomOccupancySearch,
                                                                                    dtChildrenAgeSearch);

                if (propDetails != null)
                {
                    if (User.Identity.IsAuthenticated)
                    {
                        var user = BL_WebsiteUser.GetSingleRecordById(User.Identity.GetUserId <long>());
                        propDetails.sUserTitle        = user.Title;
                        propDetails.sUserFirstName    = user.FirstName;
                        propDetails.sUserLastName     = user.LastName;
                        propDetails.sUserEmail        = user.Email;
                        propDetails.sUserMobileNo     = user.PhoneNumber;
                        propDetails.sCountryPhoneCode = user.sCountryPhoneCode;
                        propDetails.iStateId          = user.StateId.HasValue ? user.StateId.Value : 0;
                        propDetails.iUserId           = user.Id;
                    }

                    ViewBag.dExchangeRate = 1;

                    if (CurrencyCode != "INR")
                    {
                        etblExchangeRatesM objExchange = BL_ExchangeRate.GetSingleRecordById("INR", CurrencyCode);
                        if (objExchange.dRate.HasValue)
                        {
                            ViewBag.dExchangeRate = 1 / objExchange.dRate.Value;
                        }
                    }

                    //Used to Remember when Modify Search
                    ViewBag.sPropId     = propId;
                    ViewBag.scheckIn    = checkIn;
                    ViewBag.scheckOut   = checkOut;
                    ViewBag.sRoomData   = sRoomData;
                    ViewBag.iRoomId     = roomId;
                    ViewBag.iRatePlanId = ratePlanId;
                    ViewBag.IsPromo     = isPromo;

                    propDetails.iPropId    = decodedPropId;
                    propDetails.Symbol     = BL_ExchangeRate.GetSymbolByCurrencyCode(CurrencyCode);
                    propDetails.sRoomData  = sRoomData;
                    propDetails.dtCheckIn  = dtCheckIn;
                    propDetails.dtCheckOut = dtCheckOut;
                    propDetails.iTotalDays = (dtCheckOut - dtCheckIn).TotalDays.ToString();
                    propDetails.Currency   = CurrencyCode;

                    int     RatePlan = 0, iNoRoom = 0, iDays = 0, iCount = 0;
                    decimal RoomPrice    = 0;
                    decimal DTotal       = 0;
                    decimal ExtraCharges = 0;
                    decimal totalTax     = 0;
                    int     ExtraBed     = 0;
                    int     totalPoints  = 0;

                    for (int i = 0; i < propDetails.lstetblRooms.Count; i++)
                    {
                        for (int j = 0; j < propDetails.lstetblRooms[i].lstRatePlan.Count; j++)
                        {
                            for (int lstOcc = 0; lstOcc < propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy.Count; lstOcc++)
                            {
                                if (propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy[lstOcc].iNoOfRooms != 0)
                                {
                                    for (int k = 0; k < propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy[lstOcc].iNoOfRooms; k++)
                                    {
                                        ExtraBed     = propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy[lstOcc].ExtraBeds;
                                        ExtraCharges = propDetails.lstetblRooms[i].ExtraBedCharges;
                                        totalTax    += propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy[lstOcc].dTaxesForHotel;
                                        RatePlan     = propDetails.lstetblRooms[i].lstRatePlan[j].RPID;
                                        RoomPrice    = propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy[lstOcc].dPrice;
                                        isPromo      = propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy[lstOcc].blsPromo;
                                        totalPoints += propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy[lstOcc].iPoints;
                                        iNoRoom      = propDetails.lstetblRooms[i].lstRatePlan[j].lstetblOccupancy[lstOcc].iNoOfRooms;
                                        iDays        = Convert.ToInt32(propDetails.iTotalDays);
                                        iCount       = iNoRoom * iDays;

                                        RoomPrice    = RoomPrice * (iDays);
                                        ExtraCharges = (ExtraBed * ExtraCharges) * iDays;
                                        DTotal      += RoomPrice + ExtraCharges;
                                        iNoRoom++;
                                    }
                                }
                            }
                        }
                    }

                    propDetails.dSummaryRoomRate = RoomPrice;
                    propDetails.sSummaryRoomRate = clsUtils.ConvertNumberToCommaSeprated(RoomPrice);

                    propDetails.dSummaryExtraBedCharges = ExtraCharges;
                    propDetails.sSummaryExtraBedCharges = clsUtils.ConvertNumberToCommaSeprated(ExtraCharges);

                    propDetails.dSummaryTaxes = totalTax;
                    propDetails.sSummaryTaxes = clsUtils.ConvertNumberToCommaSeprated(totalTax);

                    propDetails.dSummaryTotal = DTotal;
                    propDetails.sSummaryTotal = clsUtils.ConvertNumberToCommaSeprated(DTotal);

                    propDetails.sSummaryTaxes_display = clsUtils.ConvertNumberToCommaSeprated(totalTax + propDetails.TaxCharges.TotalServiceCharge);
                    propDetails.sTotalPoints          = clsUtils.ConvertNumberToCommaSeprated(totalPoints * Convert.ToInt32(propDetails.iTotalDays));

                    propDetails.TempDataPropDetails = uniqueSessionId;

                    Session[uniqueSessionId] = propDetails;
                }

                #endregion Hotel Details

                return(View(propDetails));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #4
0
        public ActionResult PayNow(eBiddingSearch obj)
        {
            try
            {
                Decimal?      ExchangeRate = 1;
                etblBookingTx bookobj      = new etblBookingTx();

                if (User.Identity.IsAuthenticated)
                {
                    var user = BL_WebsiteUser.GetSingleRecordById(User.Identity.GetUserId <long>());
                    bookobj.iCustomerId = user.Id;
                    bookobj.iGuestId    = 0;
                }
                else
                {
                    var stronglObject          = Session[obj.BidSearchData] as eBiddingSearch;
                    GuestUserDetails objDetail = new GuestUserDetails();
                    objDetail.Title       = obj.sUserTitle == "1" ? "Mr." : obj.sUserTitle == "2" ? "Ms." : "";
                    objDetail.FirstName   = obj.sUserFirstName;
                    objDetail.LastName    = obj.sUserLastName;
                    objDetail.Email       = obj.sUserEmail;
                    objDetail.PhoneNumber = obj.sUserMobileNo;
                    objDetail.iStateId    = stronglObject.iStateId;
                    int i = BL_Bidding.AddGuestDetailsRecord(objDetail);
                    if (i > 0)
                    {
                        bookobj.iGuestId = i;
                    }
                    else
                    {
                        return(View("BiddingInfo", obj));
                    }
                }

                string CurrencyCode = Session["CurrencyCode"] != null ? Session["CurrencyCode"].ToString() : "INR";

                if (CurrencyCode != "INR")
                {
                    etblExchangeRatesM objExchange = BL_ExchangeRate.GetSingleRecordById("INR", CurrencyCode);
                    if (objExchange.dRate != 0)
                    {
                        ExchangeRate = 1 / objExchange.dRate;
                    }
                }

                bookobj.dtCheckIn         = Convert.ToDateTime(obj.sCheckIn);;
                bookobj.dtChekOut         = Convert.ToDateTime(obj.sCheckOut);
                bookobj.dtReservationDate = DateTime.Now;
                bookobj.cBookingType      = "B";
                bookobj.sTitleOFR         = obj.sUserTitle;
                bookobj.sFirstNameOFR     = obj.sUserFirstName;
                bookobj.sLastNameOFR      = obj.sUserLastName;
                bookobj.sEmailOFR         = obj.sUserEmail;
                bookobj.sMobileOFR        = obj.sUserMobileNo;
                bookobj.dtActionDate      = DateTime.Now;
                bookobj.BookingStatus     = "PP";
                bookobj.PaymentStatus     = "P";
                bookobj.dBidAmount        = obj.dBidPrice * ExchangeRate;
                bookobj.dTotalAmount      = obj.dTotalPrice * ExchangeRate;
                bookobj.dTaxes            = obj.dTaxes * ExchangeRate;
                bookobj.dTaxesForHotel    = obj.dTaxes * ExchangeRate;
                bookobj.sCurrencyCode     = Session["CurrencyCode"] != null ? Session["CurrencyCode"].ToString() : "INR";
                bookobj.iBidStarCategory  = Convert.ToInt16(obj.sStarRating);
                bookobj.sBidType          = obj.sLocalityType;
                bookobj.sIDs                = obj.sLocalityData.TrimEnd(',');
                bookobj.dServiceCharge      = Convert.ToDecimal(obj.sOFRServiceCharge);
                bookobj.dGSTOnServiceCharge = Convert.ToDecimal(obj.sTaxOnServiceCharge_Val);
                bookobj.dGSTServiceType     = obj.cGstValueType;
                bookobj.dGSTValue           = Convert.ToString(obj.dGSTValue);
                string  TimeZone = Session["TimeZone"] != null ? Session["TimeZone"].ToString() : "+5:30";
                decimal zone     = Convert.ToDecimal(TimeZone.Replace(":", ".").Replace("+", ""));
                bookobj.iCountryOffset = zone;

                #region FetchRoomData and bind in datatables

                var roomDataResult = new List <RoomData>();
                if (obj.sJsonRoomData != null)
                {
                    roomDataResult = new JavaScriptSerializer().Deserialize <List <RoomData> >(obj.sJsonRoomData);
                }

                List <etblBIDRoomAdultsTx> lstBid = new List <etblBIDRoomAdultsTx>();

                foreach (var room in roomDataResult)
                {
                    etblBIDRoomAdultsTx RoomObj = new etblBIDRoomAdultsTx();
                    RoomObj.iRoomNo   = Convert.ToInt16(room.room);
                    RoomObj.iAdults   = Convert.ToInt16(room.adult);
                    RoomObj.iChildren = Convert.ToInt16(room.child);

                    System.Text.StringBuilder str = new System.Text.StringBuilder();
                    foreach (var child in room.ChildAge)
                    {
                        str.Append(child.Age);
                        str.Append(",");
                    }

                    string ChildAges = str.ToString().TrimEnd(',');
                    RoomObj.sChildAge = ChildAges;
                    lstBid.Add(RoomObj);
                }

                #endregion

                etblBookingTrakerTx trkobj = new etblBookingTrakerTx();
                trkobj.BookingStatus = "PP";
                trkobj.dtActionDate  = DateTime.Now;

                int j = BL_Booking.AddBookingForBid(bookobj, trkobj, lstBid);
                if (j > 0)
                {
                    obj.iBookingId             = j;
                    Session[obj.BidSearchData] = obj;
                    //  TempData.Keep();
                    return(RedirectToAction("PayNow", "Payment", new { bookingId = j }));
                }
                else
                {
                }
            }
            catch (Exception)
            {
            }

            Session[obj.BidSearchData] = obj;
            //  TempData.Keep();
            return(View("BiddingInfo", obj));
        }
Example #5
0
        public ActionResult ValidateUserData(string Title, string FirstName, string LastName, string EmailID, string Mobile, string VC, string OTPCode, decimal BidAmount, string RoomData, string Localities, int RatingId, string Type, decimal Taxes, decimal MinRange, decimal MaxRange, string Symbol, string SelectedAreaId, string URL, int iStateId, string bidSearchData)
        {
            var stronglObject = new eBiddingSearch();

            try
            {
                TempData["URL"] = URL.ToString().Replace("wish-to-bid", "Search").Replace("bid", "negotiate");
                if (Session[bidSearchData] != null)
                {
                    //TempData.Keep();
                    stronglObject = Session[bidSearchData] as eBiddingSearch;
                }
                stronglObject.dBidPrice       = Convert.ToDecimal(BidAmount);
                stronglObject.sJsonRoomData   = stronglObject.sJsonRoomData;
                stronglObject.sLocalityType   = Type;
                stronglObject.sLocalityData   = Localities;
                stronglObject.sStarRating     = RatingId;
                stronglObject.dMaxRange       = MaxRange;
                stronglObject.dMinRange       = MinRange;
                stronglObject.dTaxes          = Taxes;
                stronglObject.Symbol          = Symbol;
                stronglObject.sSelectedAreaId = SelectedAreaId;
                RoomData = stronglObject.sJsonRoomData;

                stronglObject.iBiddingCount = BL_Bidding.GetBiddingCount(Mobile);

                if (stronglObject.iBiddingCount < int.Parse(ConfigurationManager.AppSettings["bidLimit"]))
                {
                    if (User.Identity.IsAuthenticated)
                    {
                        var user = BL_WebsiteUser.GetSingleRecordById(User.Identity.GetUserId <long>());
                        stronglObject.sUserTitle     = user.Title;
                        stronglObject.sUserFirstName = FirstName;
                        stronglObject.sUserLastName  = LastName;
                        stronglObject.sUserEmail     = EmailID;
                        stronglObject.iUserId        = user.Id;
                        stronglObject.iStateId       = user.StateId.HasValue ? user.StateId.Value : iStateId;

                        if (user.PhoneNumber == Mobile)
                        {
                            GetRoomDataAndDates(RoomData, stronglObject.sCheckIn, stronglObject.sCheckOut);
                            string[] ids = stronglObject.sLocalityData.TrimEnd(',').Split(',');

                            DataTable dtIds = new DataTable();
                            dtIds.Columns.AddRange(new DataColumn[1] {
                                new DataColumn("Id", typeof(int))
                            });

                            foreach (var item in ids)
                            {
                                DataRow dtLocality = dtIds.NewRow();
                                dtLocality["Id"] = item;
                                dtIds.Rows.Add(dtLocality);
                            }

                            string Currency = Session["CurrencyCode"] != null ? Session["CurrencyCode"].ToString() : "INR";
                            var    list     = BL_Bidding.SearchHotelsByBidAmount(CheckIn, CheckOut, Currency, RatingId, dtTblRoomOccupancySearch, dtTblChildrenAgeSearch, Type, dtIds, stronglObject.dBidPrice, iStateId);

                            if (list.Status == 1)
                            {
                                stronglObject.lstHotelData      = list.lstHotelData;
                                stronglObject.Amount            = list.Amount;
                                stronglObject.Tax               = list.Tax;
                                stronglObject.sCheckIn_Display  = list.sCheckIn_Display;
                                stronglObject.sCheckOut_Display = list.sCheckOut_Display;
                                stronglObject.TopMessage        = list.TopMessage;
                                stronglObject.MinTaxPer         = list.MinTaxPer;

                                stronglObject.SGST_Per                      = list.SGST_Per;
                                stronglObject.SGST_Val                      = list.SGST_Val;
                                stronglObject.sHotelTax                     = list.sHotelTax;
                                stronglObject.sOFRServiceCharge             = list.sOFRServiceCharge;
                                stronglObject.sOFRServiceChargeIncludingTax = list.sOFRServiceChargeIncludingTax;
                                stronglObject.sTaxOnServiceCharge_Per       = list.sTaxOnServiceCharge_Per;
                                stronglObject.sTaxOnServiceCharge_Val       = list.sTaxOnServiceCharge_Val;
                                stronglObject.bShowIGST                     = list.bShowIGST;
                                stronglObject.cGstValueType                 = list.cGstValueType;
                                stronglObject.dGSTValue                     = list.dGSTValue;
                            }
                            else
                            {
                                stronglObject.iBiddingCount = stronglObject.iBiddingCount + 1;
                            }
                            var maxBiddingCount = Convert.ToInt32(ConfigurationManager.AppSettings["bidLimit"]);
                            stronglObject.Message = stronglObject.iBiddingCount == (maxBiddingCount - 1)?string.Concat(list.Message, " You have only one more chance remaining."): stronglObject.iBiddingCount == maxBiddingCount? "We're sorry, but you have utilized all you three chances now." : list.Message;
                            stronglObject.Status  = list.Status;

                            //Increment bidding count for a mobile
                            bidObj.sMobile = Mobile;
                            BL_Bidding.AddRecordToBiddingCount(bidObj);

                            return(Json(new { Status = list.Status, msg = stronglObject.Message, count = stronglObject.iBiddingCount }, JsonRequestBehavior.AllowGet));
                        }
                        else
                        {
                            if (OTPCode != "" && OTPCode != null)
                            {
                                if (DecodeVC(VC) == OTPCode)
                                {
                                    GetRoomDataAndDates(RoomData, stronglObject.sCheckIn, stronglObject.sCheckOut);

                                    string[] ids = stronglObject.sLocalityData.TrimEnd(',').Split(',');

                                    DataTable dtIds = new DataTable();
                                    dtIds.Columns.AddRange(new DataColumn[1] {
                                        new DataColumn("Id", typeof(int))
                                    });

                                    foreach (var item in ids)
                                    {
                                        DataRow dtLocality = dtIds.NewRow();
                                        dtLocality["Id"] = item;
                                        dtIds.Rows.Add(dtLocality);
                                    }

                                    string Currency = Session["CurrencyCode"] != null ? Session["CurrencyCode"].ToString() : "INR";
                                    var    list     = BL_Bidding.SearchHotelsByBidAmount(CheckIn, CheckOut, Currency, RatingId, dtTblRoomOccupancySearch, dtTblChildrenAgeSearch, Type, dtIds, stronglObject.dBidPrice, iStateId);

                                    if (list.Status == 1)
                                    {
                                        stronglObject.lstHotelData      = list.lstHotelData;
                                        stronglObject.Amount            = list.Amount;
                                        stronglObject.Tax               = list.Tax;
                                        stronglObject.sCheckIn_Display  = list.sCheckIn_Display;
                                        stronglObject.sCheckOut_Display = list.sCheckOut_Display;
                                        stronglObject.TopMessage        = list.TopMessage;
                                        stronglObject.MinTaxPer         = list.MinTaxPer;

                                        stronglObject.SGST_Per                      = list.SGST_Per;
                                        stronglObject.SGST_Val                      = list.SGST_Val;
                                        stronglObject.sHotelTax                     = list.sHotelTax;
                                        stronglObject.sOFRServiceCharge             = list.sOFRServiceCharge;
                                        stronglObject.sOFRServiceChargeIncludingTax = list.sOFRServiceChargeIncludingTax;
                                        stronglObject.sTaxOnServiceCharge_Per       = list.sTaxOnServiceCharge_Per;
                                        stronglObject.sTaxOnServiceCharge_Val       = list.sTaxOnServiceCharge_Val;
                                        stronglObject.bShowIGST                     = list.bShowIGST;
                                    }
                                    else
                                    {
                                        stronglObject.iBiddingCount = stronglObject.iBiddingCount + 1;
                                    }
                                    var maxBiddingCount = Convert.ToInt32(ConfigurationManager.AppSettings["bidLimit"]);
                                    stronglObject.Message = stronglObject.iBiddingCount == (maxBiddingCount - 1) ? string.Concat(list.Message, " You have only one more chance remaining.") : stronglObject.iBiddingCount == maxBiddingCount ? "We're sorry, but you have utilized all you three chances now." : list.Message;
                                    stronglObject.Status  = list.Status;

                                    //Increment bidding count for a mobile
                                    bidObj.sMobile = Mobile;
                                    BL_Bidding.AddRecordToBiddingCount(bidObj);

                                    return(Json(new { st = 2, Status = list.Status, msg = list.Message, count = stronglObject.iBiddingCount }, JsonRequestBehavior.AllowGet));
                                }
                                else
                                {
                                    return(Json(new { st = 0, msg = "OTP is incorrect." }, JsonRequestBehavior.AllowGet));
                                }
                            }
                            else
                            {
                                string VerificationCode = ResendVerification(Mobile);
                                stronglObject.sVerificationCode = VerificationCode;
                            }
                        }
                    }
                    else
                    {
                        stronglObject.sUserTitle     = Title;
                        stronglObject.sUserFirstName = FirstName;
                        stronglObject.sUserLastName  = LastName;
                        stronglObject.sUserEmail     = EmailID;
                        stronglObject.sUserMobileNo  = Mobile;
                        stronglObject.iStateId       = iStateId;

                        if (OTPCode != "" && OTPCode != null)
                        {
                            if (DecodeVC(VC) == OTPCode)
                            {
                                GetRoomDataAndDates(RoomData, stronglObject.sCheckIn, stronglObject.sCheckOut);

                                string[] ids = stronglObject.sLocalityData.TrimEnd(',').Split(',');

                                DataTable dtIds = new DataTable();
                                dtIds.Columns.AddRange(new DataColumn[1] {
                                    new DataColumn("Id", typeof(int))
                                });

                                foreach (var item in ids)
                                {
                                    DataRow dtLocality = dtIds.NewRow();
                                    dtLocality["Id"] = item;
                                    dtIds.Rows.Add(dtLocality);
                                }

                                string Currency = Session["CurrencyCode"] != null ? Session["CurrencyCode"].ToString() : "INR";
                                var    list     = BL_Bidding.SearchHotelsByBidAmount(CheckIn, CheckOut, Currency, RatingId, dtTblRoomOccupancySearch, dtTblChildrenAgeSearch, Type, dtIds, stronglObject.dBidPrice, iStateId);

                                if (list.Status == 1)
                                {
                                    stronglObject.lstHotelData                  = list.lstHotelData;
                                    stronglObject.Amount                        = list.Amount;
                                    stronglObject.Tax                           = list.Tax;
                                    stronglObject.sCheckIn_Display              = list.sCheckIn_Display;
                                    stronglObject.sCheckOut_Display             = list.sCheckOut_Display;
                                    stronglObject.TopMessage                    = list.TopMessage;
                                    stronglObject.MinTaxPer                     = list.MinTaxPer;
                                    stronglObject.SGST_Per                      = list.SGST_Per;
                                    stronglObject.SGST_Val                      = list.SGST_Val;
                                    stronglObject.sHotelTax                     = list.sHotelTax;
                                    stronglObject.sOFRServiceCharge             = list.sOFRServiceCharge;
                                    stronglObject.sOFRServiceChargeIncludingTax = list.sOFRServiceChargeIncludingTax;
                                    stronglObject.sTaxOnServiceCharge_Per       = list.sTaxOnServiceCharge_Per;
                                    stronglObject.sTaxOnServiceCharge_Val       = list.sTaxOnServiceCharge_Val;
                                    stronglObject.bShowIGST                     = list.bShowIGST;
                                }
                                else
                                {
                                    stronglObject.iBiddingCount = stronglObject.iBiddingCount + 1;
                                }

                                var maxBiddingCount = Convert.ToInt32(ConfigurationManager.AppSettings["bidLimit"]);
                                stronglObject.Message = stronglObject.iBiddingCount == (maxBiddingCount - 1) ? string.Concat(list.Message, " You have only one more chance remaining.") : stronglObject.iBiddingCount == maxBiddingCount ? "We're sorry, but you have utilized all you three chances now." : list.Message;
                                stronglObject.Status  = list.Status;

                                //Increment bidding count for a mobile
                                bidObj.sMobile = Mobile;
                                BL_Bidding.AddRecordToBiddingCount(bidObj);

                                return(Json(new { st = 2, Status = list.Status, msg = stronglObject.Message, count = stronglObject.iBiddingCount }, JsonRequestBehavior.AllowGet));
                            }
                            else
                            {
                                return(Json(new { st = 0, msg = "OTP is incorrect." }, JsonRequestBehavior.AllowGet));
                            }
                        }
                        else
                        {
                            string VerificationCode = ResendVerification(stronglObject.sUserMobileNo);

                            if (VerificationCode == "error")
                            {
                                return(Json(new { st = 0, msg = "Kindly try after some time." }, JsonRequestBehavior.AllowGet));
                            }
                            else
                            {
                                stronglObject.sVerificationCode = VerificationCode;
                            }
                        }
                    }
                }
                else
                {
                    return(Json(new { st = 0, msg = "Sorry, you have exceeded maximum number of bid attempts for the day. Please click Bargain button to search hotels of your choice." }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { st = 0, msg = "Kindly try after some time." }, JsonRequestBehavior.AllowGet));
            }

            Session[stronglObject.BidSearchData] = stronglObject;
            //TempData.Keep();

            return(Json(new { st = 1, status = true, VC = stronglObject.sVerificationCode }, JsonRequestBehavior.AllowGet));
        }