private IEnumerable <RepresentadaViewModel> SearchByParameter(string parametro = "", string busca = "") { IEnumerable <RepresentadaViewModel> representada = new List <RepresentadaViewModel>(); if (parametro == "cnpj") { if (!string.IsNullOrEmpty(busca)) { busca = busca.Replace(".", "").Replace("-", "").Replace("/", ""); representada = _representadaAppService.ObterPorCnpj(busca); return(representada); } } else if (parametro == "nomeFantasia") { if (!string.IsNullOrEmpty(busca)) { representada = _representadaAppService.ObterPorNomeFantansia(busca); return(representada); } } else if (parametro == "razaoSocial") { if (!string.IsNullOrEmpty(busca)) { representada = _representadaAppService.ObterPorRazaoSocial(busca); return(representada); } } else { representada = _representadaAppService.ObterTodos(); return(representada); } return(representada); }
public JsonResult GetRepresentadas(string query) { return(Json(new { json = _representadaAppService.ObterTodos() }, JsonRequestBehavior.AllowGet)); }
public void PopularViewBag() { ViewBag.Representadas = _representadaAppService.ObterTodos(); }