// GET: People public ActionResult Index() { SearchModel m = new SearchModel { Action = "Search", Controller = "People", Model = PeopleModel.GetCustomSearchPeople(string.Empty, 20), Persona = new CustomPeopleModel() }; return View(m); }
public ActionResult Search(SearchModel m) { IEnumerable<CustomPeopleModel> r = PeopleModel.GetCustomSearchPeople(m.Buscar.Trim()); if (r != null && r.Count() == 1) { return PartialView("_PeopleEdit", new PeopleModel{ IdPersona = r.First().IdPersona, Persona = r.First()}); } else if (r != null && r.Count() > 1) { return PartialView("_PeopleList", r); } return PartialView("_PeopleList", new List<CustomPeopleModel>()); }