Esempio n. 1
0
        public async Task <DefMealPlanGetRes> GetDefMealPlan(DefMealPlanGetReq defMealPlanGetReq, string ticket)
        {
            DefMealPlanGetRes defMealPlanGetRes = new DefMealPlanGetRes();

            defMealPlanGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:GetDefMealPlan"), defMealPlanGetReq, typeof(DefMealPlanGetRes), ticket);

            return(defMealPlanGetRes);
        }
Esempio n. 2
0
        public DefMealPlanGetRes GetDefMealPlan([FromBody] DefMealPlanGetReq request)
        {
            var response = new DefMealPlanGetRes();

            try
            {
                response = _MasterRepository.GetDefMealPlan(request);
                response.ResponseStatus.Status = "Success";
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }

            return(response);
        }
Esempio n. 3
0
        public DefMealPlanGetRes GetDefMealPlan(DefMealPlanGetReq request)
        {
            var resultMealPlan         = new List <mDefMealPlan>();
            DefMealPlanGetRes response = new DefMealPlanGetRes();

            if (!string.IsNullOrEmpty(request.Status))
            {
                resultMealPlan = _MongoContext.mDefMealPlan.AsQueryable().Where(a => a.Status == request.Status).ToList();
            }
            else
            {
                resultMealPlan = _MongoContext.mDefMealPlan.AsQueryable().ToList();
            }
            resultMealPlan        = resultMealPlan != null && resultMealPlan.Count > 0 ? resultMealPlan : new List <mDefMealPlan>();
            response.mDefMealPlan = resultMealPlan;
            return(response);
        }
Esempio n. 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);
        }