Example #1
0
        //Add a record to guest details table
        public static int AddRecord(eBiddingSearch eobj)
        {
            int retval = 0;

            using (OneFineRateEntities db = new OneFineRateEntities())
            {
                try
                {
                    GuestUserDetails objDetail = new GuestUserDetails();
                    objDetail.Title       = eobj.sUserTitle;
                    objDetail.FirstName   = eobj.sUserFirstName;
                    objDetail.LastName    = eobj.sUserLastName;
                    objDetail.Email       = eobj.sUserEmail;
                    objDetail.PhoneNumber = eobj.sUserMobileNo;
                    OneFineRate.tblWebsiteGuestUserMaster dbuser = (OneFineRate.tblWebsiteGuestUserMaster)OneFineRateAppUtil.clsUtils.ConvertToObject(objDetail, new OneFineRate.tblWebsiteGuestUserMaster());
                    db.tblWebsiteGuestUserMasters.Add(dbuser);
                    db.SaveChanges();
                    retval = Convert.ToInt32(dbuser.Id);
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(retval);
        }
Example #2
0
        public ActionResult BiddingPreview(string bidSearchData)
        {
            var obj = new eBiddingSearch();

            if (Session[bidSearchData] != null)   //TempData.Keep();
            {
                obj = Session[bidSearchData] as eBiddingSearch;
            }
            return(View(obj));
        }
Example #3
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));
        }
Example #4
0
        public ActionResult BiddingInfo(string bidSearchData)
        {
            Decimal?ExchangeRate = 1;
            var     obj          = new eBiddingSearch();

            ViewBag.HeaderBarData = "Congratulations! We have found hotels matching your bid";

            if (Session[bidSearchData] != null)
            {
                //    TempData.Keep();
                obj = Session[bidSearchData] as eBiddingSearch;
            }

            obj.lstLocalities = BL_Bidding.GetAllLocalitiesName(obj.sLocalityData, obj.sLocalityType);

            DateTime checkin  = DateTime.Parse(obj.sCheckIn);
            DateTime checkOut = DateTime.Parse(obj.sCheckOut);

            obj.sCheckInDay  = String.Format("{0:dddd MMM d yyyy}", checkin);
            obj.sCheckOutDay = String.Format("{0:dddd MMM d yyyy}", checkOut);

            obj.iNights = Convert.ToInt32((checkOut - checkin).TotalDays);
            var data = GetRoomsCount(obj.sJsonRoomData);

            obj.iRooms     = data.room;
            obj.iChildrens = data.child;
            obj.iAdults    = data.adult;

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

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

            obj.dTaxes      = obj.Tax; //taxes provided are full n final.
            obj.dTotalPrice = obj.dBidPrice * obj.iRooms * obj.iNights;
            obj.dGrandTotal = obj.dTotalPrice + obj.dTaxes;

            return(View(obj));
        }
Example #5
0
        public ActionResult GetUserDetails(string bidSearchData)
        {
            var stronglObject = new eBiddingSearch();

            try
            {
                if (Session[bidSearchData] != null)
                {
                    // TempData.Keep();
                    stronglObject = Session[bidSearchData] as eBiddingSearch;
                }
                ViewBag.type = "G";
            }
            catch
            {
            }
            return(PartialView("pGuestDetails", stronglObject));
        }
Example #6
0
        public static eBiddingSearch SearchHotelsByBidAmount(DateTime checkin, DateTime checkout, string currency, int StarRating, DataTable dtTblRoomOccupancySearch, DataTable dtTblChildrenAgeSearch, string Type, DataTable dtIds, decimal BidAmount, int stateId)
        {
            DataSet        ds  = new DataSet();
            eBiddingSearch obj = new eBiddingSearch();

            SqlParameter[] MyParam = new SqlParameter[10];
            MyParam[0]          = new SqlParameter("@dtCheckIn", checkin);
            MyParam[1]          = new SqlParameter("@dtCheckOut", checkout);
            MyParam[2]          = new SqlParameter("@Currency", currency);
            MyParam[3]          = new SqlParameter("@iStarCategory", StarRating);
            MyParam[4]          = new SqlParameter("@RoomOccupancySearch", dtTblRoomOccupancySearch);
            MyParam[4].TypeName = "[dbo].[RoomOccupancySearch]";
            MyParam[5]          = new SqlParameter("@ChildrenAgeSearch", dtTblChildrenAgeSearch);
            MyParam[5].TypeName = "[dbo].[ChildrenAgeSearch]";
            MyParam[6]          = new SqlParameter("@sType", Type);
            MyParam[7]          = new SqlParameter("@Ids", dtIds);
            MyParam[7].TypeName = "[dbo].[Ids]";
            MyParam[8]          = new SqlParameter("@dBidAmount", BidAmount);
            MyParam[9]          = new SqlParameter("@iStateId", stateId);
            using (SqlConnection objConn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"].ToString()))
            {
                //objConn.Open();

                //ds = SqlHelper.ExecuteDataset(objConn, CommandType.StoredProcedure, "uspSearchHotelsByBid", MyParam);
                ds = SqlHelper.ExecuteDataset(objConn, CommandType.StoredProcedure, "uspSearchHotelsByBid", MyParam);

                if (ds.Tables.Count > 0)
                {
                    obj.Status            = Convert.ToInt16(ds.Tables[0].Rows[0]["status"]);
                    obj.Message           = ds.Tables[0].Rows[0]["msg"].ToString();
                    obj.Amount            = ds.Tables[0].Rows[0]["amt"].ToString() == "" ? 0 : Convert.ToDecimal(ds.Tables[0].Rows[0]["amt"].ToString());
                    obj.Tax               = ds.Tables[0].Rows[0]["Tax"].ToString() == "" ? 0 : Convert.ToDecimal(ds.Tables[0].Rows[0]["Tax"].ToString());
                    obj.sCheckIn_Display  = ds.Tables[0].Rows[0]["sCheckIn_Display"].ToString();
                    obj.sCheckOut_Display = ds.Tables[0].Rows[0]["sCheckOut_Display"].ToString();
                    obj.TopMessage        = ds.Tables[0].Rows[0]["TopMsg"].ToString();

                    obj.sTaxOnServiceCharge_Per       = ds.Tables[0].Rows[0]["TotalServiceChargeType"].ToString();
                    obj.sTaxOnServiceCharge_Val       = ds.Tables[0].Rows[0]["TaxOnServiceCharge"].ToString();
                    obj.sOFRServiceChargeIncludingTax = ds.Tables[0].Rows[0]["TotalServiceCharge"].ToString();
                    obj.sOFRServiceCharge             = ds.Tables[0].Rows[0]["ServiceCharge"].ToString();
                    obj.bShowIGST     = ds.Tables[0].Rows[0]["ShowIGST"].ToString() == "0" ? false : true;
                    obj.SGST_Per      = ds.Tables[0].Rows[0]["SGST_Per"].ToString();
                    obj.SGST_Val      = ds.Tables[0].Rows[0]["SGST_Val"].ToString();
                    obj.sHotelTax     = ds.Tables[0].Rows[0]["Tax"].ToString();
                    obj.cGstValueType = ds.Tables[0].Rows[0]["cGSTValueType"].ToString();
                    obj.dGSTValue     = Convert.ToDecimal(ds.Tables[0].Rows[0]["dGSTValue"]);
                    obj.MinTaxPer     = !string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]["MinTaxPer"]))? Convert.ToString(ds.Tables[0].Rows[0]["MinTaxPer"]):"";
                    if (obj.Status == 1)
                    {
                        List <GetHotelPreviews> lst = new List <GetHotelPreviews>();

                        for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                        {
                            lst.Add(new GetHotelPreviews()
                            {
                                Name = ds.Tables[1].Rows[i]["msg"].ToString()
                            });
                        }
                        obj.lstHotelData = lst;
                    }
                }
            }

            return(obj);
        }
Example #7
0
 public ActionResult OpenPreviewPage(eBiddingSearch obj)
 {
     Session[obj.BidSearchData] = obj;
     //  TempData.Keep();
     return(RedirectToAction("BiddingInfo"));
 }
Example #8
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 #9
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));
        }