I have a method that does the record insertion, after having inserted accurate return the id that was written, but is not returning the information. Thanks for the help.
[HttpGet]
[Route("consulta/InseriUsuario/{apiKey}/{userKey}/{nomecompleto}/{email}/{login}/{senha}/{celular}/{cidade}/{uf}/{idperfil}/{idpais}/{ididioma}")]
public HttpResponseMessage InseriUsuario(string apiKey, string userKey, string NOMECOMPLETO, string EMAIL, string LOGIN, string SENHA, string CELULAR, string CIDADE, string UF, int IDPERFIL, int IDPAIS, int IDIDIOMA )
{
try
{
var tTabela = new UsuarioAplicacao();
tTabela.InseriUsuario(apiKey, userKey, NOMECOMPLETO, EMAIL, CELULAR, CIDADE, UF, LOGIN, SENHA, IDPERFIL, IDPAIS, IDIDIOMA );
return Request.CreateResponse(HttpStatusCode.OK, tTabela.ToString());
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
}
}
public string InseriUsuario(string apiKey, string userKey, string NOMECOMPLETO, string EMAIL, string CELULAR, string CIDADE, string UF, string LOGIN, string SENHA, int IDPERFIL, int IDPAIS, int IDIDIOMA )
{
var retorno = 0;
var strQuery = "";
//insert normal
using (contexto = new Contexto())
{
var reader = contexto.ExecutaComandoComRetorno(strQuery);
while (reader.Read())
{
retorno = Convert.ToInt32(reader["IDUSUARIO"]);
}
reader.Close();
}
}
else
{
strQuery = "select * from TB_USUARIO where IDUSUARIO = 0";
}
return retorno.ToString();
}