Ejemplo n.º 1
0
        public ActionResult Index()
        {
            ListOfCountries();
            var consultants = from s in consultantUserRepo.GetConsultants()
                              where !s.FirstName.Contains("Unassigned")
                              select s;

            return(View(consultants.ToList()));
        }
Ejemplo n.º 2
0
        public ViewResult Index(string currentFilter, string searchString, int?page)
        {
            ListOfCountries();
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }

            ViewBag.CurrentFilter = searchString;

            var consultants = consultantRepo.GetConsultants()
                              .Where(x => !x.FirstName.Contains("Unassigned"));

            if (!String.IsNullOrEmpty(searchString))
            {
                consultants = consultants.Where(s => s.FirstName.Contains(searchString) ||
                                                s.LastName.Contains(searchString));
            }

            int pageSize   = 5;
            int pageNumber = (page ?? 1);

            return(View(consultants.OrderBy(x => x.FirstName).ThenBy(y => y.LastName).ToPagedList(pageNumber, pageSize)));
        }
 public IActionResult GetConsultants()
 {
     try
     {
         return(Ok(_consultantsRepository.GetConsultants()));
     }
     catch (Exception ex)
     {
         return(BadRequest());
     }
 }
Ejemplo n.º 4
0
 public Consultants(IConsultantsRepository repository)
 {
     People = repository.GetConsultants();
 }