Example #1
0
        public ActionResult Description(RechercheFondViewModel model)
        {
            var fond = GetFond(model.Id);

            if (fond == null && !model.Id.HasValue)
            {
                throw new HttpException(404, "Not found");
            }


            BuildModel(model, fond);

            return(View("~/Views/Fonds/Description.cshtml", model));
        }
Example #2
0
        public ActionResult Recherche(RechercheFondViewModel model)
        {
            var fond = GetFond(model.Id);

            if (fond == null && !model.Id.HasValue)
            {
                throw new HttpException(404, "Not found");
            }
            BuildModel(model, fond);
            var fondMedium = _unitOfWork.FondMediums.GetFondMedium(model.Id.Value,
                                                                   model.Nom,
                                                                   model.SelectedIndex.Where(b => b.Value.HasValue).Select(b => b.Value.Value),
                                                                   model.InformationsFilters,
                                                                   new PaginationRequest(model.Pagination.Valeur, model.Page));

            model.Resultats = fondMedium.ToPagedListMvc(model.Page, model.Pagination.Valeur);

            return(View("~/Views/Fonds/Recherche.cshtml", model));
        }
Example #3
0
 private void BuildModel(RechercheFondViewModel model, Fond fond)
 {
     model.Fond        = fond;
     model.GroupeIndex = GetGroupeIndex(fond);
 }