public RoutingSetReq QRFRoutingSet(QuoteRoutingViewModel model, string CurrentUser) { RoutingSetReq routingSetReq = new RoutingSetReq(); routingSetReq.QRFID = model.QRFID; routingSetReq.IsOverwriteExtPos = model.IsOverwriteExtPos; routingSetReq.IsSetPrefHotels = model.IsSetPrefHotels; routingSetReq.RoutingInfo = new List <RoutingInfo>(); model.QuoteRoutingData = model.QuoteRoutingData.Where(a => !string.IsNullOrEmpty(a.FromCityID) && !string.IsNullOrEmpty(a.ToCityID)).ToList(); foreach (var objModel in model.QuoteRoutingData) { var obj = new RoutingInfo(); obj.RouteSequence = objModel.RouteSequence; obj.RouteID = objModel.RouteID; obj.FromCityID = objModel.FromCityID; obj.ToCityID = objModel.ToCityID; obj.Days = Convert.ToInt16(objModel.Days); obj.Nights = Convert.ToInt16(objModel.Nights); obj.IsLocalGuide = objModel.IsLocalGuide; obj.PrefStarRating = objModel.PrefStarRating; obj.CreateUser = CurrentUser; obj.CreateDate = DateTime.Now; obj.EditUser = CurrentUser; obj.EditDate = DateTime.Now; routingSetReq.RoutingInfo.Add(obj); } return(routingSetReq); }
public IActionResult QuoteRouting(QuoteRoutingViewModel model) { SalesQRFMapping salesQRFMapping = new SalesQRFMapping(_configuration); RoutingSetReq routingSetReq = new RoutingSetReq(); model.SubStep = "Routing"; routingSetReq = salesQRFMapping.QRFRoutingSet(model, ckUserEmailId); routingSetReq.VoyagerUserId = ckLoginUser_Id; SalesProviders objSalesProvider = new SalesProviders(_configuration); RoutingSetRes objQuoteSearchRes = objSalesProvider.SetQRFRoutingDetails(routingSetReq, token).Result; if (objQuoteSearchRes.ResponseStatus.Status.ToLower() == "success") { TempData["success"] = "Routing details saved successfully"; } else { TempData["error"] = objQuoteSearchRes.ResponseStatus.ErrorMessage; } return(RedirectToAction("NewQuote", new { QRFId = model.QRFID, SubStep = model.SubStep })); }
public QuoteRoutingViewModel QRFRoutingGet(RoutingGetRes routingGetRes, string token) { QuoteRoutingViewModel quoteRoutingViewModel = new QuoteRoutingViewModel(); #region Bind Hotel Star Rating var objStarRating = new List <ProductAttributeDetails>(); ProductAttributeReq objProductAttributeReq = new ProductAttributeReq(); objProductAttributeReq.AttributeName = "StarRating"; ProductAttributeRes objProductAttributeRes = objMasterProviders.GetProdAttributeDetailsByNameOrVal(objProductAttributeReq, token).Result; if (objProductAttributeRes.ResponseStatus.Status == "Success" && objProductAttributeRes.ProductAttributeDetails.Count > 0) { objStarRating = objProductAttributeRes.ProductAttributeDetails.Where(a => a.Value.Contains("STD")).ToList(); } quoteRoutingViewModel.StarRatingList = objStarRating; #endregion if (routingGetRes.ResponseStatus.Status.ToLower() == "success" && routingGetRes.RoutingInfo.Count > 0) { quoteRoutingViewModel.QRFID = routingGetRes.QRFID; quoteRoutingViewModel.IsRoutingExist = true; if (routingGetRes.RoutingInfo.Where(a => !string.IsNullOrEmpty(a.PrefStarRating)).Count() > 0) { quoteRoutingViewModel.IsSetPrefHotels = true; } quoteRoutingViewModel.QuoteRoutingData = new List <QuoteRoutingData>(); foreach (var objRes in routingGetRes.RoutingInfo) { var objModel = new QuoteRoutingData(); objModel.RouteSequence = objRes.RouteSequence; objModel.RouteID = objRes.RouteID; objModel.FromCityName = objRes.FromCityName; objModel.FromCityID = objRes.FromCityID; objModel.ToCityName = objRes.ToCityName; objModel.ToCityID = objRes.ToCityID; objModel.Days = Convert.ToInt16(objRes.Days); objModel.Nights = Convert.ToInt16(objRes.Nights); objModel.IsLocalGuide = Convert.ToBoolean(objRes.IsLocalGuide); objModel.PrefStarRating = objRes.PrefStarRating; quoteRoutingViewModel.QuoteRoutingData.Add(objModel); } } else { quoteRoutingViewModel.QRFID = routingGetRes.QRFID; quoteRoutingViewModel.QuoteRoutingData = new List <QuoteRoutingData>(); var objModel = new QuoteRoutingData(); objModel.RouteSequence = 1; objModel.RouteID = 0; objModel.FromCityName = ""; objModel.FromCityID = ""; objModel.ToCityName = ""; objModel.ToCityID = ""; objModel.Days = null; objModel.Nights = null; objModel.IsLocalGuide = false; quoteRoutingViewModel.QuoteRoutingData.Add(objModel); } return(quoteRoutingViewModel); }