Ejemplo n.º 1
0
        public ActionResult Search(string location, string Hotel)
        {
            SearchViewModels model = new SearchViewModels();

            model.location = location;
            return(View());
        }
        public ActionResult SearchRoom(DateTime checkIn, DateTime checkOut, string roomType, int roomCount)
        {
            SearchViewModels obj = new SearchViewModels();

            obj.GetSearchResult(checkIn, checkOut, roomType, roomCount);
            return(View(obj));
        }
Ejemplo n.º 3
0
        public ActionResult Index(SearchViewModels model)
        {
            try
            {
                var list = Context.Articles.ToList();

                if (!(User.IsInRole("Admin") || User.IsInRole("Translator")))
                {
                    list = list.Where(a => a.validated).ToList();
                }

                if (!string.IsNullOrEmpty(model.Title))
                {
                    list = list.Where(a => a.name.Contains(model.Title)).ToList();
                }
                if (!string.IsNullOrEmpty(model.Description))
                {
                    list = list.Where(a => a.description.Contains(model.Description)).ToList();
                }
                list =
                    list.Where(
                        a =>
                        model.BeforePublishDate
                                ? DateTime.Compare(a.date, model.PublishDate) <= 0
                                : DateTime.Compare(a.date, model.PublishDate) >= 0).ToList();
                if (!string.IsNullOrEmpty(model.Author))
                {
                    list = list.Where(a => GetUserName(a.user_id).Contains(model.Author)).ToList();
                }
                //if (model.KeyWords != null && model.KeyWords.Length > 0)
                //    list = list.Where(a => a.keyWords.Contains(model.KeyWords)).ToList();
                if (model.HasImages)
                {
                    list = list.Where(HasImages).ToList();
                }
                if (model.HasDocuments)
                {
                    list = list.Where(HasDocuments).ToList();
                }

                model.Articles = list;
                return(View(model));
            }
            catch
            {
                return(View(new SearchViewModels()));
            }
        }
Ejemplo n.º 4
0
        public SearchViewModel(INetworkService networkService, IGeolocationService geolocation, IMessenger messenger)
        {
            _networkService = networkService;
            _geolocation    = geolocation;
            _messenger      = messenger;

            _nearbyStopsViewModel = new StopSearchContentViewModel(_messenger, _networkService,
                                                                   _geolocation, SearchSection.Nearby, AppResources.SearchPage_NearbyHeader);
            _linesSearchViewModel = new LineSearchContentViewModel(_networkService, _messenger,
                                                                   SearchSection.Lines, AppResources.SearchPage_LinesHeader);
            _searchStopsViewModel = new StopSearchContentViewModel(_messenger, _networkService,
                                                                   _geolocation, SearchSection.Stops, AppResources.SearchPage_StopsHeader);
            _messenger.Register <MessageTypes.ViewStateChanged>(this, ChildStateChanged);

            SearchViewModels.Add(_nearbyStopsViewModel);
            SearchViewModels.Add(_linesSearchViewModel);
            SearchViewModels.Add(_searchStopsViewModel);
        }
Ejemplo n.º 5
0
        public List <Article> AdvancedSearch(SearchViewModels model)
        {
            try
            {
                var list = Context.Articles.ToList();

                if (!string.IsNullOrEmpty(model.Title))
                {
                    list = list.Where(a => a.name.Contains(model.Title)).ToList();
                }
                if (!string.IsNullOrEmpty(model.Description))
                {
                    list = list.Where(a => a.description.Contains(model.Description)).ToList();
                }
                list =
                    list.Where(
                        a =>
                        model.BeforePublishDate
                                ? DateTime.Compare(a.date, model.PublishDate) <= 0
                                : DateTime.Compare(a.date, model.PublishDate) >= 0).ToList();
                if (!string.IsNullOrEmpty(model.Author))
                {
                    list = list.Where(a => GetUserName(a.user_id).Contains(model.Author)).ToList();
                }
                //if (model.KeyWords != null && model.KeyWords.Length > 0)
                //    list = list.Where(a => a.keyWords.Contains(model.KeyWords)).ToList();
                if (model.HasImages)
                {
                    list = list.Where(HasImages).ToList();
                }
                if (model.HasDocuments)
                {
                    list = list.Where(HasDocuments).ToList();
                }

                return(list);
            }
            catch
            {
                return(new List <Article>());
            }
        }
Ejemplo n.º 6
0
        public ActionResult MeetingGridViewPartial([ModelBinder(typeof(DevExpressEditorsBinder))] SearchViewModels searchViewModels)
        {
            var model = unitOfWork.MeetingsRepo.Get();

            return(PartialView("_MeetingGridViewPartial", model));
        }