Beispiel #1
0
        public List <AutoCompleteTextBox> GetChainList(string term, string token)
        {
            ProductAttributeReq objProductAttributeReq = new ProductAttributeReq();

            if (term.Length >= 3 && term.Substring(0, 3) == "###")
            {
                term = "";
            }
            objProductAttributeReq.AttributeName  = "Chain";
            objProductAttributeReq.Attributevalue = term;
            objProductAttributeReq.Status         = "chain";
            MasterProviders     objMasterProviders     = new MasterProviders(_configuration);
            ProductAttributeRes objProductAttributeRes = objMasterProviders.GetProdAttributeDetailsByNameOrVal(objProductAttributeReq, token).Result;

            List <AutoCompleteTextBox> chainList = new List <AutoCompleteTextBox>();

            if (objProductAttributeRes.ResponseStatus.Status == "Success" && objProductAttributeRes.ProductAttributeDetails.Count > 0)
            {
                chainList = objProductAttributeRes.ProductAttributeDetails.Select(data => new AutoCompleteTextBox {
                    value = data.AttributeId, label = data.Value
                }).ToList();
                return(chainList);
            }
            else
            {
                return(chainList);
            }
        }
        public ProductAttributeRes GetProdAttributeDetailsByNameOrVal([FromBody] ProductAttributeReq request)
        {
            var response = new ProductAttributeRes();

            try
            {
                if (request != null)
                {
                    var result = _productRepository.GetProdAttributeDetailsByNameOrVal(request);
                    if (result != null && result.Count > 0)
                    {
                        response.ResponseStatus.Status   = "Success";
                        response.ProductAttributeDetails = result;
                    }
                    else
                    {
                        response.ResponseStatus.Status       = "Success";
                        response.ResponseStatus.ErrorMessage = "No Records Found.";
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Request can not be null.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }
Beispiel #3
0
        public async Task <ProductAttributeRes> GetProdAttributeDetailsByNameOrVal(ProductAttributeReq productAttributeReq, string ticket)
        {
            ProductAttributeRes productAttributeRes = new ProductAttributeRes();

            productAttributeRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:ServiceGetProdAttributeDetailsByNameOrVal"), productAttributeReq, typeof(ProductAttributeRes), ticket);

            return(productAttributeRes);
        }
Beispiel #4
0
        public bool BindAccomodationMasterData(IConfiguration _configuration, string token, ref AccomodationViewModel model, int totalRecord)
        {
            ProductAttributeReq objProductAttributeReq;
            ProductAttributeRes objProductAttributeRes;

            //bool GetStatus = false;

            //#region Get Quote Info By QRFId
            //NewQuoteViewModel modelQuote = new NewQuoteViewModel();
            //modelQuote.QRFID = model.MenuViewModel.QRFID;
            //SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
            //GetStatus = salesQuoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
            ////if (GetStatus)
            ////{
            ////    model.TourInfoHeaderViewModel = modelQuote.TourInfoHeaderViewModel;
            ////}
            //#endregion

            // #region Bind StartingFrom and NoOfNights
            //var objAccomodationData = new AccomodationData();
            //  List<AttributeValues> listSF = new List<AttributeValues>();
            //  List<AttributeValues> listNON = new List<AttributeValues>();

            //if (modelQuote.mdlQuoteAgentInfoViewModel.Duration > 0)
            //{
            //    for (int i = 1; i <= modelQuote.mdlQuoteAgentInfoViewModel.Duration; i++)
            //    {
            //       // listSF.Add(new AttributeValues { AttributeValue_Id = i.ToString(), Value = "Day " + i });
            //        listNON.Add(new AttributeValues { AttributeValue_Id = i.ToString(), Value = i.ToString() });
            //    }
            // //   listSF.Add(new AttributeValues { AttributeValue_Id = (modelQuote.mdlQuoteAgentInfoViewModel.Duration + 1).ToString(), Value = "Day " + (modelQuote.mdlQuoteAgentInfoViewModel.Duration + 1) });
            //}
            //else
            //{
            //   // listSF.Add(new AttributeValues { AttributeValue_Id = "1", Value = "Day 1" });
            //    listNON.Add(new AttributeValues { AttributeValue_Id = "1", Value = "1" });
            //}

            //   #endregion

            #region Bind Hotel category
            var objCategory = new List <ProdCatDefProperties>();

            objProductAttributeReq = new ProductAttributeReq();
            objProductAttributeReq.AttributeName = "Budgetprice Category";
            objProductAttributeRes = objMasterProviders.GetProdAttributeDetailsByNameOrVal(objProductAttributeReq, token).Result;

            if (objProductAttributeRes.ResponseStatus.Status == "Success" && objProductAttributeRes.ProductAttributeDetails.Count > 0)
            {
                objCategory = objProductAttributeRes.ProductAttributeDetails.Select(a => new ProdCatDefProperties
                {
                    VoyagerDefProductCategoryId = a.AttributeId + "|" + a.Value,
                    Name = a.Value
                }).ToList();
            }

            //ProdCatDefGetReq objProdCatDefGetReq = new ProdCatDefGetReq();
            //ProdCatDefGetRes objProdCatDefGetRes = objMasterProviders.GetProdCatDefByName(objProdCatDefGetReq, token).Result;

            //if (objProdCatDefGetRes.ResponseStatus.Status == "Success" && objProdCatDefGetRes.ProdCatDefProperties.Count > 0)
            //{
            //    //objCategory = objProdCatDefGetRes.ProdCatDefProperties;
            //    objCategory = objProdCatDefGetRes.ProdCatDefProperties.Select(a => new ProdCatDefProperties
            //    {
            //        VoyagerDefProductCategoryId = a.VoyagerDefProductCategoryId + "|" + a.Name,
            //        Name = a.Name
            //    }).ToList();
            //}
            #endregion

            #region Bind Hotel Star Rating
            var objStarRating = new List <ProductAttributeDetails>();

            objProductAttributeReq = new ProductAttributeReq();
            objProductAttributeReq.AttributeName = "StarRating";
            objProductAttributeRes = objMasterProviders.GetProdAttributeDetailsByNameOrVal(objProductAttributeReq, token).Result;

            if (objProductAttributeRes.ResponseStatus.Status == "Success" && objProductAttributeRes.ProductAttributeDetails.Count > 0)
            {
                objStarRating = objProductAttributeRes.ProductAttributeDetails;
            }
            #endregion

            #region Bind Hotel Location
            var objLocation = new List <ProductAttributeDetails>();

            objProductAttributeReq = new ProductAttributeReq();
            objProductAttributeReq.AttributeName = "Location";
            objProductAttributeRes = objMasterProviders.GetProdAttributeDetailsByNameOrVal(objProductAttributeReq, token).Result;

            if (objProductAttributeRes.ResponseStatus.Status == "Success" && objProductAttributeRes.ProductAttributeDetails.Count > 0)
            {
                objLocation = objProductAttributeRes.ProductAttributeDetails;
            }
            #endregion

            #region Meal Plan
            //var objMealPlan = new List<ProductAttributeDetails>();

            //objProductAttributeReq = new ProductAttributeReq();
            //objProductAttributeReq.AttributeName = "Board";
            //objProductAttributeRes = objMasterProviders.GetProdAttributeDetailsByNameOrVal(objProductAttributeReq, token).Result;

            //if (objProductAttributeRes.ResponseStatus.Status == "Success" && objProductAttributeRes.ProductAttributeDetails.Count > 0)
            //{
            //    objMealPlan = objProductAttributeRes.ProductAttributeDetails;
            //}

            var objMealPlan = new List <ProductAttributeDetails>();

            var defMealPlanGetReq = new DefMealPlanGetReq();
            defMealPlanGetReq.Status = "false";
            DefMealPlanGetRes objDefMealPlanGetRes = objMasterProviders.GetDefMealPlan(defMealPlanGetReq, token).Result;

            if (objDefMealPlanGetRes.ResponseStatus.Status == "Success" && objDefMealPlanGetRes.mDefMealPlan.Count > 0)
            {
                objMealPlan = objDefMealPlanGetRes.mDefMealPlan.Select(a => new ProductAttributeDetails {
                    AttributeId = a.MealPlan, Value = a.Description
                }).ToList();
            }
            #endregion

            #region Bind Keep As
            var objKeepAs = new List <AttributeValues>();

            MasterTypeRequest objMasterTypeRequest = new MasterTypeRequest();
            objMasterTypeRequest.Property = "QRF Masters";
            objMasterTypeRequest.Name     = "Position Type";

            SalesProviders     objSalesProvider      = new SalesProviders(_configuration);
            MasterTypeResponse objMasterTypeResponse = objSalesProvider.GetGenericMasterForType(objMasterTypeRequest, token).Result;

            if (objMasterTypeResponse.Status == "Success" && objMasterTypeResponse.PropertyList.Count > 0)
            {
                if (objMasterTypeResponse.PropertyList[0].Attribute[0].AttributeName == "Position Type")
                {
                    objKeepAs = objMasterTypeResponse.PropertyList[0].Attribute[0].Values.ToList();
                }
            }
            #endregion

            for (int i = 0; i < totalRecord; i++)
            {
                //  model.AccomodationData[i].StartingFromList = listSF;
                // model.AccomodationData[i].NoOfNightList = listNON;
                model.AccomodationData[i].CategoryList   = objCategory;
                model.AccomodationData[i].StarRatingList = objStarRating;
                model.AccomodationData[i].LocationList   = objLocation;
                model.AccomodationData[i].MealPlanList   = objMealPlan;
                model.AccomodationData[i].KeepAsList     = objKeepAs;
            }

            return(true);
        }
Beispiel #5
0
        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);
        }