Ejemplo n.º 1
0
        public async Task <IActionResult> SearchPlaces(int practiceId, string placeTerm, string clientTerm, string addressTerm, int page, int take)
        {
            if (placeTerm == null)
            {
                placeTerm = "";
            }

            if (clientTerm == null)
            {
                clientTerm = "";
            }

            if (addressTerm == null)
            {
                addressTerm = "";
            }

            return(Json(
                       await _placesService.GetPlacesListViewModelForPracticeIfAdmin(
                           practiceId,
                           new SubscriberDashboardAjaxSearchViewModel()
            {
                AddressTerm = addressTerm.ToLower(),
                ClientNameTerm = clientTerm.ToLower(),
                PlaceNameTerm = placeTerm.ToLower(),
                Page = page - 1,
                Take = take
            })));
        }