// GET: Room Details public ActionResult RoomInfo(string propid, string roomid) { string CurrencyCode = Session["CurrencyCode"] != null ? Session["CurrencyCode"].ToString() : "INR"; RoomDetails objRoomDetails = BL_PropDetails.GetRoomDetails(Convert.ToInt32(propid), Convert.ToInt32(roomid), CurrencyCode); return(PartialView("pvRoomInfo", objRoomDetails)); }
// GET: Room Details public ActionResult RoomInfo(string propid, string roomid) { TempData.Keep(); RoomDetails objRoomDetails = BL_PropDetails.GetRoomDetails(Convert.ToInt32(propid), Convert.ToInt32(roomid), CurrencyCode); return(PartialView("pvRoomInfo", objRoomDetails)); }
public ActionResult UpdateConversionViews(string Id, string type) { string PropId = OneFineRateAppUtil.clsUtils.Decode(Id.ToString()); //Insert data in view conversion table DataTable dtPropIds = new DataTable(); dtPropIds.Columns.AddRange(new DataColumn[1] { new DataColumn("Id", typeof(int)) }); DataRow drpropid = dtPropIds.NewRow(); drpropid["Id"] = Convert.ToInt32(PropId); dtPropIds.Rows.Add(drpropid); Task.Run(() => BL_PropDetails.UpdateViewForConversion(type, dtPropIds)); return(Json(true, JsonRequestBehavior.AllowGet)); }
public ActionResult GetBidSearchedHotelDetails(string sPropId, string sRoomId) { if (!string.IsNullOrEmpty(sPropId)) { string CurrencyCode = Session["CurrencyCode"] != null ? Session["CurrencyCode"].ToString() : "INR"; int propId = Convert.ToInt32(clsUtils.Decode(sPropId)); int roomId = Convert.ToInt32(clsUtils.Decode(sRoomId)); PropDetailsM objSearch = new PropDetailsM(); objSearch.iPropId = propId; objSearch.dtCheckIn = DateTime.Now.Date.AddDays(10); objSearch.dtCheckOut = DateTime.Now.Date.AddDays(11); objSearch.bLogin = User.Identity.IsAuthenticated; objSearch.Currency = CurrencyCode; #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)) }); #endregion var propDetails = BL_PropDetails.GetPropertyDetails(propId, objSearch, dtRoomOccupancySearch, dtChildrenAgeSearch); var roomDetails = BL_PropDetails.GetRoomDetails(propId, roomId, CurrencyCode); propDetails.BidRoomDetails = roomDetails; return(View("_HotelDetails", propDetails)); } return(View("Error")); }
public ActionResult GetBidSearchedHotels(string bookingId) { int bookId = Convert.ToInt32(clsUtils.Decode(bookingId)); //fetch the data of booking var booking = BL_Booking.GetBooking(bookId); if (booking.iPropId != null) { return(RedirectToAction("Index", "Home")); } eBidding objdata = new eBidding(); objdata = BL_Bidding.GetSearchedBidHotelsListForUnfinished(bookId); if (objdata.lstBidRoomsData.Count > 0) { DataTable dtPropIds = new DataTable(); dtPropIds.Columns.AddRange(new DataColumn[1] { new DataColumn("Id", typeof(int)) }); foreach (var item in objdata.lstBidRoomsData) { DataRow drpropid = dtPropIds.NewRow(); drpropid["Id"] = item.iPropId; dtPropIds.Rows.Add(drpropid); } BL_PropDetails.UpdateViewForConversion("B", dtPropIds, bookId); } objdata.iBookingId = bookId; objdata.BidSearchHotels = "BidSearchHotels" + Guid.NewGuid().ToString(); Session[objdata.BidSearchHotels] = objdata; return(View(objdata)); }
//public ActionResult GetRoomData(string din, string dout, string d) //{ // PropDetailsM objlist = new PropDetailsM(); // if (HttpContext.Request.Params["Id"] != null) { HotelId = Convert.ToInt32(OneFineRateAppUtil.clsUtils.Decode(HttpContext.Request.Params["Id"].ToString())); } // if (TempData["propDetails"] != null) { TempData.Keep(); objlist = TempData["propDetails"] as PropDetailsM; } // int roomno = 0; // int ID = 0; // short iAdults = 0; // short children = 0; // 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)) }); // short Age = 0; // DataTable dtChildrenAgeSearch = new DataTable(); // dtChildrenAgeSearch.Columns.AddRange(new DataColumn[2] { new DataColumn("ID", typeof(int)), // new DataColumn("Age", typeof(short))}); // PropDetailsM objSearch = new PropDetailsM(); // objSearch.iPropId = HotelId == 0 ? objlist.iPropId : HotelId; // objSearch.dtCheckIn = OneFineRateAppUtil.clsUtils.ConvertmmddyyyytoDateTime(din); // objSearch.dtCheckOut = OneFineRateAppUtil.clsUtils.ConvertmmddyyyytoDateTime(dout); // objSearch.bLogin = true; // objSearch.Currency = Session["CurrencyCode"].ToString(); // objSearch.bIsAirConditioning = false; // objSearch.bIsBathtub = false; // objSearch.bIsFlatScreenTV = false; // objSearch.bIsSoundproof = false; // objSearch.bIsView = false; // objSearch.bIsInternetFacilities = false; // objSearch.bIsPrivatePool = false; // objSearch.bIsRoomService = false; // objSearch.dMinPrice = 0; // objSearch.dMaxPrice = 0; // objSearch.SpecialDeal = true; // if (d != null) // { // JArray jArray = (JArray)JsonConvert.DeserializeObject(d.Replace("\\", "\"")); // if (jArray != null) // { // //List<etblPropertyParkingMap> lstPropertyParkingMap = new List<etblPropertyParkingMap>(); // foreach (var item in jArray) // { // roomno++; // ID = roomno; // iAdults = Convert.ToInt16(item["adult"]); // children = Convert.ToInt16(item["child"]); // dtRoomOccupancySearch.Rows.Add(ID, iAdults, children); // foreach (var item1 in item["ChildAge"]) // { // ID = roomno; // string Agevalue = Convert.ToString(item1["Age"]); // if (Agevalue == "<1") // Age = 0; // else // Age = Convert.ToInt16(item1["Age"]); // dtChildrenAgeSearch.Rows.Add(ID, Age); // } // } // } // } // objlist = BL_PropDetails.GetPropertyDetails(objlist.iPropId, objSearch, dtRoomOccupancySearch, dtChildrenAgeSearch); // objlist.dtCheckIn = OneFineRateAppUtil.clsUtils.ConvertmmddyyyytoDateTime(din); // objlist.dtCheckOut = OneFineRateAppUtil.clsUtils.ConvertmmddyyyytoDateTime(dout); // objlist.iTotalDays = (objSearch.dtCheckOut - objSearch.dtCheckIn).TotalDays.ToString(); // objlist.Currency = Session["CurrencyCode"].ToString(); // return PartialView("pvHotelRooms", objlist); //} public ActionResult GetGoogleSharePage(long propId) { var propDetail = BL_PropDetails.GetPropDetailForSharing(propId); return(View("_ShareGooglePartial", propDetail)); }
// GET: OfferReview /// <summary> /// Load the Hoteal page for public view /// </summary> /// <param name="model"></param> /// <returns></returns> public ActionResult Index(PropSearchRequestModel model) { //Fetch OFR service charge // Session["BidMaster"] = BL_Bidding.GetBidMaster(CurrencyCode); PropDetailsM objlist = new PropDetailsM(); string Slocation = ""; string CIn = ""; string COut = ""; string Modify = ""; string sRoomData = ""; if (HttpContext.Request.Params["Slocation"] != null) { Slocation = HttpContext.Request.Params["Slocation"]; } if (HttpContext.Request.Params["CIn"] != null) { CIn = HttpContext.Request.Params["CIn"].ToString(); } if (HttpContext.Request.Params["COut"] != null) { COut = HttpContext.Request.Params["COut"].ToString(); } if (HttpContext.Request.Params["M"] != null) { Modify = HttpContext.Request.Params["M"]; } if (HttpContext.Request.Params["Id"] != null) { HotelId = Convert.ToInt32(OneFineRateAppUtil.clsUtils.Decode(HttpContext.Request.Params["Id"].ToString())); } if (HttpContext.Request.Params["sRoomData"] != null) { sRoomData = HttpContext.Request.Params["sRoomData"].ToString(); } //To make a count to update in the database Task.Run(() => BL_PropDetails.UpdateRecentViewAsync(HotelId, User.Identity.GetUserId <long>())); if (Modify == "1") //In this modify user can only chnage the check in check out date with in the hotel { if (Session[model.PropDetailsTempData] != null) //Take the data form the View only { objlist = Session[model.PropDetailsTempData] as PropDetailsM; ViewData["dOFRServiceCharge"] = (objlist.TaxCharges.dOFRServiceCharge + objlist.TaxCharges.TaxOnServiceCharge); // TempData.Keep(); } objlist.sRequestType = model.sRequestType; objlist.bOccuData = true; return(View(objlist)); } if (CIn != "" && COut != "" && sRoomData != "") { #region FetchRoomData and bind in datatables var roomDataResult = new List <RoomData>(); if (model.sRoomData != null) { roomDataResult = new JavaScriptSerializer().Deserialize <List <RoomData> >(model.sRoomData); } DataTable dtTblRoomOccupancySearch = new DataTable(); dtTblRoomOccupancySearch.Columns.AddRange(new DataColumn[3] { new DataColumn("ID", typeof(int)), new DataColumn("iAdults", typeof(short)), new DataColumn("children", typeof(short)) }); DataTable dtTblChildrenAgeSearch = new DataTable(); dtTblChildrenAgeSearch.Columns.AddRange(new DataColumn[2] { new DataColumn("ID", typeof(int)), new DataColumn("Age", typeof(short)) }); foreach (var room in roomDataResult) { DataRow roomOccupancy = dtTblRoomOccupancySearch.NewRow(); roomOccupancy["ID"] = room.room; roomOccupancy["iAdults"] = room.adult; roomOccupancy["children"] = room.child; dtTblRoomOccupancySearch.Rows.Add(roomOccupancy); foreach (var child in room.ChildAge) { DataRow dtChildrenAge = dtTblChildrenAgeSearch.NewRow(); dtChildrenAge["ID"] = room.room; dtChildrenAge["Age"] = child.Age; dtTblChildrenAgeSearch.Rows.Add(dtChildrenAge); } } #endregion #region OfferReviewTracker //To Track the request form which ip on which date and the same get saved into DB also var tracker = new etblOfferReviewTrackerTx(); tracker.iPropId = HotelId; tracker.dtActionDate = DateTime.Now; tracker.sIPAddress = OneFineRateAppUtil.clsUtils.getIpAddress(); //Get IP Address using "HTTP_X_FORWARDED_FOR" Server Variables //Call to Business logic to add record BL_tblOfferReviewTrackerTx.AddRecord(tracker); #endregion // To get all room of the selected hotel which is full fill the occupancy and the other criteria objlist.iPropId = HotelId; objlist.dtCheckIn = DateTime.Parse(CIn); objlist.dtCheckOut = DateTime.Parse(COut); objlist.bLogin = User.Identity.IsAuthenticated; objlist.Currency = CurrencyCode; objlist.bIsAirConditioning = false; objlist.bIsBathtub = false; objlist.bIsFlatScreenTV = false; objlist.bIsSoundproof = false; objlist.bIsView = false; objlist.bIsInternetFacilities = false; objlist.bIsPrivatePool = false; objlist.bIsRoomService = false; objlist.dMinPrice = 0; objlist.dMaxPrice = 0; objlist.SpecialDeal = true; //Bussiness logic call to search tha available room objlist = BL_PropDetails.GetPropertyDetails(objlist.iPropId, objlist, dtTblRoomOccupancySearch, dtTblChildrenAgeSearch); //When no room available if (objlist.lstetblRooms.Count == 0) { objlist.bRoomAvailable = false; } objlist.sCheckInDate = CIn; objlist.sCheckOutDate = COut; objlist.dtCheckIn = DateTime.Parse(CIn); objlist.dtCheckOut = DateTime.Parse(COut); objlist.iTotalDays = (objlist.dtCheckOut - objlist.dtCheckIn).TotalDays.ToString(); objlist.Currency = CurrencyCode; objlist.hdnJsonData = sRoomData; objlist.sRequestType = model.sRequestType; if (objlist.TaxCharges != null) { ViewData["dOFRServiceCharge"] = (objlist.TaxCharges.dOFRServiceCharge + objlist.TaxCharges.TaxOnServiceCharge); } string propDetailsName = "propDetails" + Guid.NewGuid().ToString(); objlist.TempDataPropDetails = propDetailsName; Session[propDetailsName] = objlist; //s.Keep(propDetailsName); return(View(objlist)); } if (HotelId != 0) { PropDetailsM objSearch = new PropDetailsM(); objSearch.iPropId = HotelId; objSearch.dtCheckIn = DateTime.Now.Date.AddDays(5); objSearch.dtCheckOut = DateTime.Now.Date.AddDays(6); objSearch.bLogin = User.Identity.IsAuthenticated; objSearch.Currency = CurrencyCode; objSearch.bIsAirConditioning = false; objSearch.bIsBathtub = false; objSearch.bIsFlatScreenTV = false; objSearch.bIsSoundproof = false; objSearch.bIsView = false; objSearch.bIsInternetFacilities = false; objSearch.bIsPrivatePool = false; objSearch.bIsRoomService = false; objSearch.dMinPrice = 0; objSearch.dMaxPrice = 0; objSearch.SpecialDeal = true; #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)) }); #endregion #region RoomOccupancySearch DataTable dtTblRoomOccupancySearch = new DataTable(); dtTblRoomOccupancySearch.Columns.AddRange(new DataColumn[3] { new DataColumn("ID", typeof(int)), new DataColumn("iAdults", typeof(short)), new DataColumn("children", typeof(short)) }); DataTable dtTblChildrenAgeSearch = new DataTable(); dtTblChildrenAgeSearch.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); } else { roomDataResult = new List <RoomData> { new RoomData { adult = 2, room = 1, child = 0, ChildAge = new List <ChildAge>() } }; } foreach (var room in roomDataResult) { DataRow roomOccupancy = dtTblRoomOccupancySearch.NewRow(); roomOccupancy["ID"] = room.room; roomOccupancy["iAdults"] = room.adult; roomOccupancy["children"] = room.child; dtTblRoomOccupancySearch.Rows.Add(roomOccupancy); foreach (var child in room.ChildAge) { DataRow dtChildrenAge = dtTblChildrenAgeSearch.NewRow(); dtChildrenAge["ID"] = room.room; dtChildrenAge["Age"] = child.Age; dtTblChildrenAgeSearch.Rows.Add(dtChildrenAge); } } #endregion #region OfferReviewTracker var tracker = new etblOfferReviewTrackerTx(); tracker.iPropId = HotelId; tracker.dtActionDate = DateTime.Now; tracker.sIPAddress = OneFineRateAppUtil.clsUtils.getIpAddress(); BL_tblOfferReviewTrackerTx.AddRecord(tracker); #endregion objlist = BL_PropDetails.GetPropertyDetails(HotelId, objSearch, dtRoomOccupancySearch, dtChildrenAgeSearch); objlist.sRequestType = model.sRequestType; objlist.bRoomAvailable = true; objlist.sRequestType = model.sRequestType; if (objlist.TaxCharges != null) { ViewData["dOFRServiceCharge"] = (objlist.TaxCharges.dOFRServiceCharge + objlist.TaxCharges.TaxOnServiceCharge); } string propDetailsName = "propDetails" + Guid.NewGuid().ToString(); objlist.TempDataPropDetails = propDetailsName; TempData[propDetailsName] = objlist; TempData.Keep(propDetailsName); } return(View(objlist)); }
public ActionResult Login(OneFineRateBLL.Entities.eLogin model, string returnUrl) { TempData["Error"] = null; if (ModelState.IsValid) { OneFineRateBLL.BL_Login.UserDetails eobj = new OneFineRateBLL.BL_Login.UserDetails(); OneFineRateBLL.BL_Login.UserDetails eobjActiveUser = new OneFineRateBLL.BL_Login.UserDetails(); OneFineRateAppUtil.clsUtils.ConvertToObject(OneFineRateBLL.BL_Login.ValidateUser(model.UserName, model.Password), eobj); OneFineRateAppUtil.clsUtils.ConvertToObject(OneFineRateBLL.BL_Login.ActiveUser(model.UserName), eobjActiveUser); if (eobj.iUserId > 0 && eobjActiveUser.cStatus == "A") { if (model.RememberMe) { Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(30); Response.Cookies["Password"].Expires = DateTime.Now.AddDays(30); } else { Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1); Response.Cookies["Password"].Expires = DateTime.Now.AddDays(-1); } Response.Cookies["UserName"].Value = model.UserName.Trim(); Response.Cookies["Password"].Value = model.Password.Trim(); Session["UserDetails"] = eobj; Session["MenuType"] = "1"; //Session["Username"] = eobj.UserName; //Session["FisrtName"] = eobj.FisrtName; //Session["LastName"] = eobj.LastName; string sPath = OneFineRateBLL.BL_Menu.GetHomePageByUserId(eobj.iUserId); if (sPath != null) { FormsAuthentication.SetAuthCookie(model.UserName, true); #region Redirect For Booking Confirmation if (model.sBookingId != null) { var bookingIdDecoded = OneFineRateAppUtil.clsUtils.Decode(model.sBookingId); var iPropId = BL_Booking.GetPropIdByBookingId(bookingIdDecoded); if (iPropId.HasValue) { Session["MenuType"] = "2"; Session["PropId"] = iPropId; Session["CurrCode"] = BL_Currency.GetCurrencyByPropId(iPropId.Value); //Session["Symbol"] = BL_Currency.GetSymbolByPropId(PropId); Session["Flag"] = BL_Currency.GetFlagByPropId(iPropId.Value); Session["PropName"] = BL_PropDetails.GetPropertyName(iPropId.Value); return(RedirectToRoute("BookingConfirmation", new { bookingId = model.sBookingId })); } } #endregion Redirect For Pending Confirmation #region Redirect For Pending Negotiation if (model.sPropId != null) { int iPropId = 0; try { iPropId = int.Parse(clsUtils.Decode(model.sPropId)); } catch (Exception) { } if (iPropId > 0) { Session["MenuType"] = "2"; Session["PropId"] = iPropId; Session["CurrCode"] = BL_Currency.GetCurrencyByPropId(iPropId); //Session["Symbol"] = BL_Currency.GetSymbolByPropId(PropId); Session["Flag"] = BL_Currency.GetFlagByPropId(iPropId); Session["PropName"] = BL_PropDetails.GetPropertyName(iPropId); return(RedirectToAction("Index", "PendingNegotiations")); } } #endregion string[] Values = sPath.Split('/'); if (Values.Length == 2) { //FormsAuthentication.RedirectFromLoginPage(model.UserName, model.RememberMe); return(RedirectToAction("Index", Values[1])); } else { //FormsAuthentication.RedirectFromLoginPage(model.UserName, model.RememberMe); return(RedirectToAction(Values[2], Values[1])); } } else { TempData["Error"] = "All the Groups are Inactive for this user."; } } if (eobj.iUserId == 0) { // ModelState.AddModelError("", "Incorrect username and/or password"); TempData["Error"] = "Incorrect username and/or password"; } else if (eobjActiveUser.cStatus == "I") { TempData["Error"] = "User has been diasbled by Administrator."; } } return(View(model)); }
public ActionResult Index(string propId, string checkIn, string checkOut, string sRoomData) { PropDetailsM propDetailRequestModel = new PropDetailsM(); PropDetailsM propDetails = new PropDetailsM(); if (!string.IsNullOrEmpty(propId)) { if (!string.IsNullOrEmpty(checkIn) && !string.IsNullOrEmpty(checkOut)) { propDetailRequestModel.dtCheckIn = DateTime.Parse(checkIn); propDetailRequestModel.dtCheckOut = DateTime.Parse(checkOut); } else { propDetailRequestModel.dtCheckIn = DateTime.Now.Date.AddDays(1); propDetailRequestModel.dtCheckOut = DateTime.Now.Date.AddDays(2); checkIn = DateTime.Today.ToString("dd/MM/yyyy"); checkOut = DateTime.Today.AddDays(1).ToString("dd/MM/yyyy"); } var decodedPropId = Convert.ToInt32(clsUtils.Decode(propId)); propDetailRequestModel.iPropId = decodedPropId; propDetailRequestModel.iUserId = User.Identity.GetUserId <int>(); propDetailRequestModel.Currency = CurrencyCode; #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); } else { roomDataResult = new List <RoomData> { new RoomData { adult = 2, room = 1, child = 0, ChildAge = new List <ChildAge>() } }; } 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; dtChildrenAge["Age"] = child.Age; dtChildrenAgeSearch.Rows.Add(dtChildrenAge); } } #endregion #region OfferReviewTracker var tracker = new etblOfferReviewTrackerTx(); tracker.iPropId = decodedPropId; tracker.dtActionDate = DateTime.Now; tracker.sIPAddress = OneFineRateAppUtil.clsUtils.getIpAddress(); BL_tblOfferReviewTrackerTx.AddRecord(tracker); #endregion propDetails = BL_PropDetails.GetPropertyDetailsToRedeemPoints(decodedPropId, propDetailRequestModel, dtRoomOccupancySearch, dtChildrenAgeSearch); propDetails.bRoomAvailable = true; propDetails.cStatus = "A"; propDetails.dtCheckIn = propDetailRequestModel.dtCheckIn; propDetails.dtCheckOut = propDetailRequestModel.dtCheckOut; propDetails.sCheckInDate = checkIn; propDetails.sCheckOutDate = checkOut; propDetails.sRoomData = sRoomData; propDetails.hdnJsonData = sRoomData; ViewBag.GuestDetailString = roomDataResult.FirstOrDefault().adult + roomDataResult.FirstOrDefault().child + " Guests in 1 Room"; var uniqueSessionId = Guid.NewGuid().ToString(); propDetails.TempDataPropDetails = uniqueSessionId; } return(View(propDetails)); }
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; } }
public int SendMailToRevenueManager(int bookingId) { try { var customerModel = new NegotiationEmailTempleteModel(); // Added to show hotel Information in email template var bookingModel = BL_Booking.GetBookingModifyDetails_Notifications(bookingId); customerModel.BookingModify = bookingModel; Decimal?ExchangeRate = 1; // get from tblEmailSetting var revenueManagerDetail = BL_tblEmailSettingsM.GetRecord("RevenueManager"); // get from propertyEdit page var pRevenueManager = BL_PropDetails.GetEmail_PhoneByPropId(bookingModel.PropId); string sPrimaryContactEmail; string sConfirmationContactEmail; string sRevenueManagerEmail; string sRevenueManagerContact; pRevenueManager.TryGetValue("sPrimaryContactEmail", out sPrimaryContactEmail); pRevenueManager.TryGetValue("sConfirmationContactEmail", out sConfirmationContactEmail); pRevenueManager.TryGetValue("sRevenueManagerEmail", out sRevenueManagerEmail); pRevenueManager.TryGetValue("sRevenueManagerContact", out sRevenueManagerContact); string emails = sRevenueManagerEmail + "," + sConfirmationContactEmail + "," + sPrimaryContactEmail; customerModel = new NegotiationEmailTempleteModel(); customerModel.BookingModify = bookingModel; //customerModel.Status = "Thanks " + bookingModel.Booker + "! We have recieved your negotiation." + Environment.NewLine + "We will get back to you within 3 hours."; customerModel.Status = "Thank you " + bookingModel.Booker + "! We have recieved your bargain." + Environment.NewLine + bookingModel.sMessage; var revenuManagerModel = new NegotiationEmailTempleteModel(); //revenuManagerModel.Status = "Hi " + revenueManageName +", Please take action for the following Negotiation Request."; revenuManagerModel.Status = "Hi, Please take action for the following bargain Request."; revenuManagerModel.IsRevenueManagerFormat = true; if (bookingModel.sCurrencyCode != "INR") { etblExchangeRatesM objExchange = BL_ExchangeRate.GetSingleRecordById("INR", bookingModel.sCurrencyCode); if (objExchange.dRate != null) { ExchangeRate = 1 / objExchange.dRate; } } bookingModel.dTotalNegotiateAmount = bookingModel.dTotalNegotiateAmount * ExchangeRate; bookingModel.dTaxes = Convert.ToDecimal(bookingModel.Tax) * Convert.ToDecimal(ExchangeRate); revenuManagerModel.BookingModify = bookingModel; string extranetUrl = Request.Url.GetLeftPart(UriPartial.Authority) + "Account/Login?sPropId=" + clsUtils.Encode(bookingModel.PropId.ToString()); string shortExtranetUrl = clsUtils.Shorten(extranetUrl); string notificationMsg_RevenueMgr = "You have received a new bargain offer. The guest has chosen your hotel! Click " + shortExtranetUrl + " to view the offer and process yet another reservation from OFR. This offer is valid for the next three hours."; var html_RevenueManager = this.RenderViewToString("_NegotiationEmailTemplete", revenuManagerModel); Task.Run(() => clsUtils.sendSMS(sRevenueManagerContact, notificationMsg_RevenueMgr)); Task.Run(() => MailComponent.SendEmail(sRevenueManagerEmail, revenueManagerDetail.sEmail, "", "Reminder - New Bargain", html_RevenueManager, null, null, true, null, null)); return(1); } catch (Exception ex) { return(0); } }
//[OutputCache(Duration = 30, VaryByParam = "Id;cIn;cOut;sLocation;sRoomData", VaryByCustom = "User")] // Cached for 30 second public ActionResult Index(string Id, string cIn, string cOut, string sLocation, string sRoomData, string sRequestType) { PropDetailsM propDetails = new PropDetailsM(); if (!string.IsNullOrEmpty(Id)) { PropSearchRequestModel dbRequestParamModel = new PropSearchRequestModel(); dbRequestParamModel.iVendorId = Id; var roomDataResult = new List <RoomData>(); #region RoomOccupancySearch DataTable dtTblRoomOccupancySearch = new DataTable(); dtTblRoomOccupancySearch.Columns.AddRange(new DataColumn[3] { new DataColumn("ID", typeof(int)), new DataColumn("iAdults", typeof(short)), new DataColumn("children", typeof(short)) }); DataTable dtTblChildrenAgeSearch = new DataTable(); dtTblChildrenAgeSearch.Columns.AddRange(new DataColumn[2] { new DataColumn("ID", typeof(int)), new DataColumn("Age", typeof(short)) }); if (!string.IsNullOrEmpty(cIn) && !string.IsNullOrEmpty(cOut)) { dbRequestParamModel.dtCheckIn = DateTime.Parse(cIn); dbRequestParamModel.dtCheckOut = DateTime.Parse(cOut); } else { dbRequestParamModel.dtCheckIn = DateTime.Now.Date.AddDays(1); dbRequestParamModel.dtCheckOut = DateTime.Now.Date.AddDays(2); cIn = DateTime.Today.ToString("dd/MM/yyyy"); cOut = DateTime.Today.AddDays(1).ToString("dd/MM/yyyy"); } dbRequestParamModel.bLogin = User.Identity.IsAuthenticated; dbRequestParamModel.sCurrency = CurrencyCode; //Insert the room data in the table created if (!string.IsNullOrEmpty(sRoomData)) { roomDataResult = new JavaScriptSerializer().Deserialize <List <RoomData> >(sRoomData); } else { roomDataResult.Add(new RoomData() { adult = 2, child = 0, room = 1, ChildAge = new List <ChildAge>() { new ChildAge() { Age = "0" } } }); } foreach (var room in roomDataResult) { DataRow roomOccupancy = dtTblRoomOccupancySearch.NewRow(); roomOccupancy["ID"] = room.room; roomOccupancy["iAdults"] = room.adult; roomOccupancy["children"] = room.child; dtTblRoomOccupancySearch.Rows.Add(roomOccupancy); foreach (var child in room.ChildAge) { DataRow dtChildrenAge = dtTblChildrenAgeSearch.NewRow(); dtChildrenAge["ID"] = room.room; dtChildrenAge["Age"] = child.Age; dtTblChildrenAgeSearch.Rows.Add(dtChildrenAge); } } sRoomData = clsUtils.ConvertToJson(roomDataResult); #endregion string roomIds = string.Empty; List <string> roomIdsArr = new List <string>(); List <int> hotelAmenitiesIdsArr = new List <int>(); var ofrServiceCharge = BL_PropDetailsTG.GetOfrServiceCharge(dbRequestParamModel.dtCheckIn, dbRequestParamModel.dtCheckOut); //Get TG hotel details var hotelDetailsFromApi = clsSearchHotel.FetchHotelsDetailsByVendorId(false, dbRequestParamModel.iVendorId, dbRequestParamModel.dtCheckIn.ToString("yyyy-MM-dd"), dbRequestParamModel.dtCheckOut.ToString("yyyy-MM-dd"), dtTblRoomOccupancySearch, dtTblChildrenAgeSearch, roomDataResult); if (hotelDetailsFromApi != null && !string.IsNullOrEmpty(hotelDetailsFromApi.HotelCode)) { roomIdsArr = hotelDetailsFromApi.RoomDetails.Select(x => x.RoomId).ToList(); roomIds = string.Join(",", roomIdsArr); hotelAmenitiesIdsArr = hotelDetailsFromApi.HotelAmenities.Select(x => int.Parse(x.code)).ToList(); hotelDetailsFromApi.HotelAmenities = BL_PropDetailsTG.GetHotelAmenities(hotelAmenitiesIdsArr.ToArray()); if (hotelDetailsFromApi.GalleryImages.Count <= 0) { propDetails = BL_PropDetailsTG.GetPropertyDetails(dbRequestParamModel.iVendorId, roomIds); } else { propDetails = BL_PropDetailsTG.GetPropertyDetailsWithoutGallery(dbRequestParamModel.iVendorId, roomIds); } } else { propDetails = BL_PropDetailsTG.GetPropertyDetails(dbRequestParamModel.iVendorId, roomIds); } propDetails.ServiceChargeTG = ofrServiceCharge; propDetails.cStatus = "A"; propDetails.iVendorId = Id; propDetails.sRoomData = sRoomData; propDetails.scheckIn = cIn; propDetails.scheckOut = cOut; propDetails.dtCheckIn = dbRequestParamModel.dtCheckIn; propDetails.dtCheckOut = dbRequestParamModel.dtCheckOut; hotelDetailsFromApi.RoomAmenities = propDetails.TG_Hotel.RoomAmenities; propDetails.TG_Hotel = hotelDetailsFromApi; propDetails.sRequestType = sRequestType; propDetails.Currency = dbRequestParamModel.sCurrency; if (propDetails.TG_Hotel != null && propDetails.TG_Hotel.RoomAmenities != null) { foreach (var roomId in roomIdsArr) { var tgRoom = hotelDetailsFromApi.RoomDetails.Where(x => x.RoomId == roomId).FirstOrDefault(); tgRoom.RoomAmenities = propDetails.TG_Hotel.RoomAmenities.Where(x => x.iRoomTypeId == tgRoom.RoomId).ToList(); } } Task.Run(() => BL_PropDetails.UpdateRecentViewAsync(propDetails.iPropId, User.Identity.GetUserId <long>())); ViewBag.dExchangeRate = 1; if (CurrencyCode != "INR") { etblExchangeRatesM objExchange = BL_ExchangeRate.GetSingleRecordById("INR", CurrencyCode); if (objExchange.dRate.HasValue) { ViewBag.dExchangeRate = objExchange.dRate.Value; } } propDetails.Symbol = BL_ExchangeRate.GetSymbolByCurrencyCode(CurrencyCode); } return(View(propDetails)); }