This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model IEnumerable<OpenMVC.Models.AcidentesDeTrabalho> | |
@{ | |
ViewBag.Title = "Index"; | |
} | |
<table> | |
<tr class="editor-label"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult Index() | |
{ | |
var retornoOpenData = Helpers.Builder.Download_And_Serialize_Data<RootObject>("http://api.dataprev.gov.br/previdencia/anuario/2009/acidentes-do-trabalho.json"); | |
var lista = retornoOpenData.acidentes_de_trabalho.Take(15); | |
return View(lista); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
namespace OpenMVC.Helpers | |
{ | |
public class Builder | |
{ | |
public static T Download_And_Serialize_Data<T>(string url) where T : new() | |
{ | |
using (var w = new WebClient()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AcidentesComCat | |
{ | |
public int trajeto { get; set; } | |
public int doenca { get; set; } | |
public int tipicos { get; set; } | |
} | |
public class Quantidade | |
{ | |
public AcidentesComCat acidentes_com_cat { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
public class Program { | |
/** | |
* @param args | |
* @throws IOException |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Script.Serialization; | |
namespace cliente.Helper | |
{ | |
public static class Json | |
{ | |
public static string ToJSON(this object obj) | |
{ | |
var _serializador = new JavaScriptSerializer(); | |
return _serializador.Serialize(obj); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using cliente.Helper; | |
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
namespace cliente | |
{ | |
internal class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace cliente | |
{ | |
public class Pessoa | |
{ | |
public string Age { get; set; } | |
public string Name { get; set; } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<system.web> | |
<compilation debug="true" targetFramework="4.0" /> | |
</system.web> | |
<system.serviceModel> | |
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"> | |
</serviceHostingEnvironment> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ServiceModel.Activation; | |
using System.Web.Routing; | |
namespace appRest | |
{ | |
public class Global : System.Web.HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) | |
{ |