public IActionResult GetListYachtName([FromQuery] YachtSearchModel searchModel) { //LogHelper.InsertLog() var result = _yachtService.GetListYachtName(searchModel); return(Ok(result)); }
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(); }
public async Task <IActionResult> YachtSearchIndex(YachtSearchModel searchModel) { if (searchModel.Passengers == 0) { searchModel.Passengers = 1; } var model = await PreparingYatchSearchViewModel(searchModel); return(View(model)); }
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; }
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); }
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 })); }
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; }
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)); }
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); }
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)); } }
//*****modified by hoangle 10-10-2019 //*****next modified by public IActionResult PrivateCharter([FromQuery] YachtSearchModel searchModel) { var result = _yachtService.PrivateCharterSearch(searchModel); return(Ok(result)); }
public IViewComponentResult Invoke(YachtSearchModel model) { return(View("YachtSearchBox", model)); }