예제 #1
0
        public IActionResult GetListYachtName([FromQuery] YachtSearchModel searchModel)
        {
            //LogHelper.InsertLog()
            var result = _yachtService.GetListYachtName(searchModel);

            return(Ok(result));
        }
예제 #2
0
 public YachtSearchViewModel()
 {
     Categories       = new List <CommonValueViewModel>();
     CharterTypes     = new List <CommonValueViewModel>();
     YachtTypes       = new List <CommonValueViewModel>();
     HullTypes        = new List <CommonValueViewModel>();
     YatchItems       = new PagedListClient <YachtPrivateCharterViewModel>();
     YachtSearchModel = new YachtSearchModel();
 }
예제 #3
0
        public async Task <IActionResult> YachtSearchIndex(YachtSearchModel searchModel)
        {
            if (searchModel.Passengers == 0)
            {
                searchModel.Passengers = 1;
            }

            var model = await PreparingYatchSearchViewModel(searchModel);

            return(View(model));
        }
예제 #4
0
        private void PreparingYachtLink(YachtItem item, YachtSearchModel searchModel)
        {
            string yachtId = Terminator.Encrypt(item.YachtID);

            var passParams = new YachtPassParamsModel(0, 0, searchModel);
            //string paramsData = passParams.EncryptData();
            string detailLink = Url.RouteUrl("YachtDetail", new { id = yachtId });

            detailLink += CommonHelper.ConvertToUrlParameter(passParams).ToLower();
            item.CustomProperties["DetailLink"] = detailLink;
        }
예제 #5
0
        private async Task <YachtSearchViewModel> PreparingYatchSearchViewModel(YachtSearchModel searchModel)
        {
            var model = new YachtSearchViewModel();

            model.YachtSearchModel = searchModel;

            var typeResponse = await _commonValueService.GetListCommonValueByGroup(CommonValueConstant.YACHT_TYPE);

            model.YachtTypes = typeResponse.GetDataResponse();
            return(model);
        }
예제 #6
0
        public async Task <IActionResult> YachtSearchResult(YachtSearchModel searchModel)
        {
            var model = await PreparingYarchItemsModel(searchModel);

            string url = ($"{_webHelper.GetHostName()}{Url.Action("YachtSearchIndex").TrimStart('/')}{_webHelper.GetQueryString()}").ToLower();

            return(Ok(new
            {
                model,
                url
            }));
        }
예제 #7
0
 public YachtPassParamsModel(double price, int pricingTypeId, YachtSearchModel searchModel)
 {
     CheckIn       = searchModel.CheckIn;
     CheckOut      = searchModel.CheckOut;
     City          = searchModel.City;
     Passengers    = searchModel.Passengers;
     YachtName     = searchModel.YachtName;
     YachtTypeFID  = searchModel.YachtTypeFID;
     Price         = price;
     PricingTypeId = pricingTypeId;
     PortFID       = searchModel.PortFID;
     Country       = searchModel.Country;
 }
예제 #8
0
        public async Task <IActionResult> YachtSearchSimilarResult(string yachtId, string country, YachtSimilarSearchModel searchModel)
        {
            searchModel.ExcludeYachtID = Convert.ToInt32(Terminator.Decrypt(yachtId));
            var yatchApiResponse = await _yatchService.SearchSimilar(searchModel);

            var responseData    = yatchApiResponse.GetDataResponse();
            var searchModelPass = new YachtSearchModel
            {
                CheckIn    = searchModel.CheckIn,
                CheckOut   = searchModel.CheckOut,
                City       = searchModel.City,
                Passengers = searchModel.NumOfPassenger,
                Country    = country
            };

            foreach (var item in responseData)
            {
                await PreparingYachtCustomProperties(item);

                PreparingYachtLink(item, searchModelPass);
            }
            return(Ok(responseData));
        }
예제 #9
0
        private async Task <PagedListClient <YachtSearchItem> > PreparingYarchItemsModel(YachtSearchModel model)
        {
            if (string.IsNullOrEmpty(model.CheckIn))
            {
                model.CheckIn = DateTime.Now.ToString("dd-MMM-yyyy");
            }
            if (string.IsNullOrEmpty(model.CheckOut))
            {
                model.CheckOut = DateTime.Now.AddDays(7).ToString("dd-MMM-yyyy");
            }
            model.PageSize = model.PageSize > 0 ? model.PageSize : 15;
            var yatchApiResponse = await _yatchService.Search(model);

            var responseData = yatchApiResponse.GetDataResponse();

            foreach (var item in responseData.Data)
            {
                await PreparingYachtCustomProperties(item);

                PreparingYachtLink(item, model);
            }
            return(responseData);
        }
예제 #10
0
        public async Task <BaseResponse <PagedListClient <YachtSearchItem> > > Search(YachtSearchModel searchModel)
        {
            try
            {
                string url       = _baseYatchApiUrl + _yachtPortalApiUrl.Yatchs.Search;
                string paramater = ConvertToUrlParameter(searchModel);
                url = url + paramater;
                var response = await _apiExcute.GetData <PagedListClient <YachtSearchItem> >(url, null);

                return(response);
            }
            catch (Exception ex)
            {
                return(BaseResponse <PagedListClient <YachtSearchItem> > .InternalServerError(message : ex.Message, fullMsg : ex.StackTrace));
            }
        }
예제 #11
0
        //*****modified by hoangle 10-10-2019
        //*****next modified by
        public IActionResult PrivateCharter([FromQuery] YachtSearchModel searchModel)
        {
            var result = _yachtService.PrivateCharterSearch(searchModel);

            return(Ok(result));
        }
예제 #12
0
 public IViewComponentResult Invoke(YachtSearchModel model)
 {
     return(View("YachtSearchBox", model));
 }