Example #1
0
        public JsonResult GetCountOrganizations()
        {
            var response = new DefaultJsonResponse();

            try
            {
                response.Message      = OrganizationService.CountOrganizations().ToString();
                response.IsValid      = true;
                response.TypeResponse = TypeResponse.Success;
            }
            catch (Exception)
            {
                response.Message      = "Ocorreu um erro ao buscar a quantidade de empresas cadastradas.";
                response.IsValid      = false;
                response.TypeResponse = TypeResponse.Error;
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }