示例#1
0
        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);
        }
示例#2
0
 public JsonResult GetRepresentadas(string query)
 {
     return(Json(new { json = _representadaAppService.ObterTodos() }, JsonRequestBehavior.AllowGet));
 }
示例#3
0
 public void PopularViewBag()
 {
     ViewBag.Representadas = _representadaAppService.ObterTodos();
 }