Advertisement
Guest User

Untitled

a guest
May 30th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. public static int getId(string m) {
  2. List<Moeda> contasBancarias;
  3. Dictionary<string, Moeda[]> docs;
  4. docs = Api.getDataFromWebAPI_EX<Moeda[]>(Api.EnderecoWebAPI + "/rest/api/v1/moedas", new Moeda[] { });
  5. /// Auth a = Api.postDataToWebAPI<Auth>(Api.EnderecoWebAPI + "/rest/login", new Login { Username = username, Password = password }, new Auth { });
  6. // MessageBox.Show(Api.Token + " - " + Api.TokenType);
  7. DataTable dt = new DataTable();
  8. dt.Columns.Add("Codigo");
  9. dt.Columns.Add("Descricao");
  10. if (docs.Count > 0)
  11. {
  12.  
  13. contasBancarias = docs["moedas"].ToList();
  14. foreach (Moeda conta in contasBancarias)
  15. {
  16.  
  17. if (conta.codigo.ToUpper().Equals(m))
  18. return conta.ID;
  19.  
  20. }
  21.  
  22. }
  23. return 0;
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement