コード例 #1
0
        public JsonResult GetPickUpDropOffLocations(string term)
        {
            MasterTypeRequest objMasterTypeRequest = new MasterTypeRequest();

            if (term.Length >= 3 && term.Substring(0, 3) == "###")
            {
                term = "";
            }
            objMasterTypeRequest.Property = "QRF Masters";
            objMasterTypeRequest.Name     = "PickUpDropOffLocations";
            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 == "PickUpDropOffLocations")
                {
                    List <AutoCompleteTextBox> pickUpDropOffLocationsList = new List <AutoCompleteTextBox>();
                    var result = objMasterTypeResponse.PropertyList[0].Attribute[0].Values.ToList().Where(p => p.Value.ToLower().Contains(term.ToLower()));
                    pickUpDropOffLocationsList = result.Select(data => new AutoCompleteTextBox {
                        value = data.AttributeValue_Id, label = data.Value
                    }).ToList();
                    return(Json(pickUpDropOffLocationsList));
                }
                else
                {
                    return(Json(""));
                }
            }
            else
            {
                return(Json(""));
            }
        }
コード例 #2
0
        public IQueryable <Properties> GetGenericMasterForTypeByProperty(MasterTypeRequest Request)
        {
            var result = (from t in _MongoContext.mTypeMaster.AsQueryable()
                          where t.PropertyType.PropertyName == Request.Property
                          select t.PropertyType).ToList();

            //new Properties
            //{
            //    PropertyName = t.PropertyType.PropertyName,
            //    Property_Id = t.PropertyType.Property_Id,
            //    Attribute = t.PropertyType.Attribute
            //};
            //var result2 = _MongoContext.mTypeMaster.AsQueryable().Where(a => a.PropertyType.PropertyName == Request.Property).Select(b => b.PropertyType);
            //var result1 = result.ToList();
            result.ForEach(a =>
            {
                a.Attribute.ForEach(b =>
                {
                    b.Values = b.Values.OrderBy(c => c.SequenceNo).ToList();
                });
            });

            //result.AsQueryable().FirstOrDefault().Attribute.ForEach(b => b.Values.OrderBy(c => c.Value));
            return(result.AsQueryable());
        }
コード例 #3
0
        public IActionResult ViewIntegrationPlatform(IntegrationPlatformViewModel model)
        {
            Integration_Search_Request request = new Integration_Search_Request();

            model.ApplicationList = userAndRoleMgmtProviders.GetApplicationAttributes(request, token).Result.Application_DataList;

            MasterTypeRequest objMasterTypeRequest = new MasterTypeRequest {
                Property = "QRF Masters", Name = "Integration_Modules"
            };
            MasterTypeResponse objMasterTypeResponse = objSalesProvider.GetGenericMasterForType(objMasterTypeRequest, token).Result;

            model.ModuleList = objMasterTypeResponse.PropertyList[0].Attribute[0].Values.OrderBy(a => a.Value).ToList();

            objMasterTypeRequest = new MasterTypeRequest {
                Property = "QRF Masters", Name = "Integration_Actions"
            };
            objMasterTypeResponse = objSalesProvider.GetGenericMasterForType(objMasterTypeRequest, token).Result;
            model.ActionList      = objMasterTypeResponse.PropertyList[0].Attribute[0].Values.OrderBy(a => a.Value).ToList();
            List <string> actionList = new List <string>()
            {
                "GET", "PUT", "POST", "PATCH", "DELETE"
            };

            model.Type = actionList;
            return(PartialView("~/Areas/Settings/Views/UserAndRoleMgmt/_ViewIntegrationPlatform.cshtml", model));
        }
コード例 #4
0
        public async Task <MasterTypeResponse> GetGenericMasterForType(MasterTypeRequest objMasterTypeRequest, string ticket)
        {
            MasterTypeResponse objMasterTypeResponse = new MasterTypeResponse();

            objMasterTypeResponse = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:GetGenericMasterForType"), objMasterTypeRequest, typeof(MasterTypeResponse), ticket);

            return(objMasterTypeResponse);
        }
コード例 #5
0
        public IQueryable <dynamic> GetGenericMasterForTypeByName(MasterTypeRequest Request)
        {
            var result = from t in _MongoContext.mTypeMaster.AsQueryable()
                         where t.PropertyType.PropertyName == Request.Property
                         select t;

            var results = from u in result.AsQueryable()
                          select u.PropertyType.Attribute.Where(y => y.AttributeName == Request.Name);

            return(results);
        }
コード例 #6
0
        public MasterTypeResponse GetGenericMasterForType([FromBody] MasterTypeRequest request)
        {
            var response = new MasterTypeResponse();

            if (!string.IsNullOrWhiteSpace(request.Property))
            {
                if (!string.IsNullOrWhiteSpace(request.Name))
                {
                    var result    = _MasterRepository.GetGenericMasterForTypeByName(request);
                    var Attribute = new List <Attributes>();
                    var Property  = new Properties();
                    if (result.Count() > 0)
                    {
                        foreach (var x in result)
                        {
                            Property.Attribute = x;
                        }
                        Property.PropertyName = request.Property;
                        response.PropertyList.Add(Property);
                        response.Status = "Success";
                        return(response);
                    }
                    else
                    {
                        response.Status = "Invalid AttributeName";
                        return(response);
                    }
                }
                else
                {
                    var results = _MasterRepository.GetGenericMasterForTypeByProperty(request);
                    if (results.Count() > 0)
                    {
                        foreach (var x in results)
                        {
                            response.PropertyList.Add(x);
                        }
                        response.PropertyList.ForEach(a => a.Attribute.ForEach(b => b.Values = b.Values.OrderBy(c => c.Value).ToList()));
                        response.Status = "Success";
                        return(response);
                    }
                    else
                    {
                        response.Status = "Invalid PropertyName";
                        return(response);
                    }
                }
            }
            else
            {
                response.Status = "Failure";
                return(response);
            }
        }
コード例 #7
0
        public IActionResult SearchHotels()
        {
            HotelsDeptViewModel model = new HotelsDeptViewModel();

            #region Dropdown Binding
            MasterTypeRequest objMasterTypeRequest = new MasterTypeRequest {
                Property = "QRF Masters", Name = "BookingSearchDateType"
            };
            MasterTypeResponse objMasterTypeResponse = objSalesProvider.GetGenericMasterForType(objMasterTypeRequest, token).Result;
            #endregion

            #region Get Booking Details
            BookingSearchRes response = new BookingSearchRes();
            response = bookingProviders.GetBookingStatusList(token).Result;
            #endregion

            string[] StatusIgnoreList = new string[] { "N", "J", "I", "B", "C", "-", "^", "L", "S", "X", "T" };
            model.HotelsDeptSearchFilters.DateTypeList      = objMasterTypeResponse.PropertyList[0].Attribute[0].Values.OrderBy(a => a.Value).ToList();
            model.HotelsDeptSearchFilters.BookingStatusList = response.BookingStatusList.Where(a => !StatusIgnoreList.Contains(a.Attribute_Id)).OrderBy(a => a.AttributeName).ToList();
            return(View(model));
        }
コード例 #8
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);
        }
コード例 #9
0
        public IActionResult ViewSalesPipelineRoles(string tabName)
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(tabName))
                {
                    ViewBag.tabName = tabName;
                }

                SalesPipelineViewModel model = new SalesPipelineViewModel();

                #region Destination dropdown binding
                MasterTypeRequest objMasterTypeRequest = new MasterTypeRequest();
                objMasterTypeRequest.Property = "QRF Masters";
                objMasterTypeRequest.Name     = "QRF Destination";
                SalesProviders     objSalesProvider      = new SalesProviders(_configuration);
                MasterTypeResponse objMasterTypeResponse = objSalesProvider.GetGenericMasterForType(objMasterTypeRequest, token).Result;

                model.DestinationList = objMasterTypeResponse.PropertyList[0].Attribute[0].Values.Select(a => new AttributeValues
                {
                    AttributeValue_Id = a.AttributeValue_Id,
                    CityName          = a.Value.Contains("|") ? a.Value.Split("|")[0].Trim() : "",
                    Value             = a.Value.Contains("|") ? a.Value.Split("|")[1].Trim() : a.Value
                }).ToList();
                #endregion

                #region Role dropdown binding
                UserByRoleGetRes response = new UserByRoleGetRes();
                UserByRoleGetReq request  = new UserByRoleGetReq();
                request.RoleName = new List <string>()
                {
                    "Costing Officer", "Product Accountant"
                };
                response       = loginProviders.GetRoleIdByRoleName(request, token).Result;
                model.RoleList = response.Users.Select(x => new AttributeValues {
                    AttributeValue_Id = x.UserRoleId, Value = x.UserRole
                }).ToList();
                #endregion

                #region Sales Office dropdown binding
                CompanyOfficerGetRes res = new CompanyOfficerGetRes();
                res = agentProviders.GetSalesOfficesOfSystemCompany(token).Result;
                model.SalesOfficeList = res.Branches.Select(x => new AttributeValues {
                    AttributeValue_Id = x.Company_Id, Value = x.Company_Name
                }).ToList();
                #endregion

                #region Destination list binding
                SettingsGetReq request1  = new SettingsGetReq();
                SettingsGetRes response1 = new SettingsGetRes();
                request1.Type = "Destination";
                request1.LoggedInUserContact_Id = ckUserContactId;
                response1 = userAndRoleMgmtProviders.GetSalesPipelineRoles(request1, token).Result;
                model.RolesByDestinationList = response1.Values.ToList();
                model.RolesByDestinationList.Add(new Values());
                #endregion

                #region Sales office list binding
                SettingsGetReq request2  = new SettingsGetReq();
                SettingsGetRes response2 = new SettingsGetRes();
                request2.Type = "SalesOffice";
                request2.LoggedInUserContact_Id = ckUserContactId;
                response2 = userAndRoleMgmtProviders.GetSalesPipelineRoles(request2, token).Result;
                model.RolesBySalesOfficeList = response2.Values.ToList();
                model.RolesBySalesOfficeList.Add(new Values());
                #endregion

                return(PartialView("~/Areas/Settings/Views/UserAndRoleMgmt/_ViewSalesPipelineRoles.cshtml", model));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #10
0
        public IActionResult GetGuesstimateData(string QRFID, string filterByDay = null, string filterByServiceType = null, string filterByPackageType = null, long filterByDeparture = 0, long filterByPaxSlab = 0, string SuccessMessage = null, string ErrorMessage = null, string CalculateFor = null)
        {
            try
            {
                if (!(string.IsNullOrEmpty(SuccessMessage)))
                {
                    TempData["success"] = SuccessMessage;
                }

                if (!(string.IsNullOrEmpty(ErrorMessage)))
                {
                    TempData["error"] = ErrorMessage;
                }

                GuesstimateViewModel model = new GuesstimateViewModel();

                //#region Get Summary Detailsby QRFId
                //qrfSummaryGetReq = new QRFSummaryGetReq();
                //qrfSummaryGetReq.QRFID = QRFID;
                //qrfSummaryGetRes = qrfSummaryProviders.GetQRFSummary(qrfSummaryGetReq, token).Result;
                //model.SummaryDetails = qrfSummaryMapping.GetQRFSummaryDetails(qrfSummaryGetRes, token);
                //#endregion

                #region Filter Dropdown Bindings

                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();
                    }
                }

                QRFDepartureDateGetReq objDepartureDatesReq = new QRFDepartureDateGetReq()
                {
                    QRFID = QRFID, date = (DateTime?)null
                };
                QRFDepartureDateGetRes objDepartureDatesRes = coProviders.GetDepartureDatesForCostingByQRF_Id(objDepartureDatesReq, token).Result;
                QRFPaxSlabGetReq       objPaxSlabReq        = new QRFPaxSlabGetReq()
                {
                    QRFID = QRFID
                };
                QRFPaxGetResponse objPaxSlabRes = coProviders.GetPaxSlabDetailsForCostingByQRF_Id(objPaxSlabReq, token).Result;
                model.PaxSlabList = (objPaxSlabRes.PaxSlabDetails.QRFPaxSlabs).Select(a => new AttributeValues {
                    AttributeValue_Id = a.PaxSlab_Id.ToString(), Value = a.From + "-" + a.To
                }).ToList();
                model.DepartureDatesList = (objDepartureDatesRes.DepartureDates).Select(a => new AttributeValues {
                    AttributeValue_Id = a.Departure_Id.ToString(), Value = Convert.ToDateTime(a.Date).ToString("dd MMM yy")
                }).ToList();

                #endregion

                #region Get Guesstimate by QRFId
                GuesstimateGetRes response = new GuesstimateGetRes();
                GuesstimateGetReq request  = new GuesstimateGetReq();
                request.QRFID        = QRFID;
                request.DepartureId  = filterByDeparture == 0 ? objDepartureDatesRes.DepartureDates[0].Departure_Id : filterByDeparture;
                request.PaxSlabId    = filterByPaxSlab == 0 ? objPaxSlabRes.PaxSlabDetails.QRFPaxSlabs[0].PaxSlab_Id : filterByPaxSlab;
                request.CalculateFor = CalculateFor;
                request.LoginUserId  = ckUserEmailId;
                response             = coProviders.GetGuesstimate(request, token).Result;
                GetDistinctRanges(response.Guesstimate, ref model);
                model.Guesstimate                    = response.Guesstimate;
                model.Guesstimate.VersionId          = model.Guesstimate.VersionId;
                ViewBag.VersionName                  = model.Guesstimate.VersionName;
                ViewBag.VersionDescription           = model.Guesstimate.VersionDescription;
                model.Guesstimate.VersionName        = "";
                model.Guesstimate.VersionDescription = "";
                model.NextVersionId                  = response.LastVersionId + 1;
                model.IsStandardPrice                = response.IsStandardPrice;
                #endregion

                #region Filter Logic

                model.DayList         = GetDays(model.Guesstimate.GuesstimatePosition);
                model.ServiceTypeList = GetProductTypes(model.Guesstimate.GuesstimatePosition);
                model.KeepAsList      = objKeepAs;

                if (filterByDay == "All")
                {
                    filterByDay = null;
                }

                if (filterByServiceType == "All")
                {
                    filterByServiceType = null;
                }

                if (filterByPackageType == "All")
                {
                    filterByPackageType = null;
                }

                if (!string.IsNullOrEmpty(filterByDay))
                {
                    model.Guesstimate.GuesstimatePosition = model.Guesstimate.GuesstimatePosition.Where(x => x.Day == filterByDay).ToList();
                }

                if (!string.IsNullOrEmpty(filterByServiceType))
                {
                    model.Guesstimate.GuesstimatePosition = model.Guesstimate.GuesstimatePosition.Where(x => x.ProductType == filterByServiceType).ToList();
                }

                if (!string.IsNullOrEmpty(filterByPackageType))
                {
                    model.Guesstimate.GuesstimatePosition = model.Guesstimate.GuesstimatePosition.Where(x => x.KeepAs == filterByPackageType).ToList();
                }

                //model.Guesstimate.GuesstimateDetails = model.Guesstimate.GuesstimateDetails.Where(x => model.SummaryDetails.Any(a => a.OriginalItineraryDetails.Any(b => b.PositionId == x.PositionId))).ToList();

                model.Day           = filterByDay;
                model.Service       = filterByServiceType;
                model.KeepAs        = filterByPackageType;
                model.DepartureDate = filterByDeparture.ToString();
                model.PaxSlab       = filterByPaxSlab.ToString();

                #endregion

                return(PartialView("_Guesstimate", model));
            }
            catch (Exception ex)
            {
                throw;
                return(View());
            }
        }