Ejemplo n.º 1
0
 // POST /TaxaAdministracao/token/
 public HttpResponseMessage Post(string token, [FromBody] TaxaAdministracao param)
 {
     try
     {
         HttpResponseMessage retorno = new HttpResponseMessage();
         if (Permissoes.Autenticado(token))
         {
             return(Request.CreateResponse <Int32>(HttpStatusCode.OK, GatewayTaxaAdministracao.Add(token, param)));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.Unauthorized));
         }
     }
     catch
     {
         throw new HttpResponseException(HttpStatusCode.InternalServerError);
     }
 }
Ejemplo n.º 2
0
 // DELETE /TaxaAdministracao/token/id
 public HttpResponseMessage Delete(string token, Int32 id)
 {
     try
     {
         HttpResponseMessage retorno = new HttpResponseMessage();
         if (Permissoes.Autenticado(token))
         {
             GatewayTaxaAdministracao.Delete(token, id);
             return(Request.CreateResponse(HttpStatusCode.OK));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.Unauthorized));
         }
     }
     catch
     {
         throw new HttpResponseException(HttpStatusCode.InternalServerError);
     }
 }
Ejemplo n.º 3
0
 // GET /TaxaAdministracao/token/colecao/campo/orderBy/pageSize/pageNumber?CAMPO1=VALOR&CAMPO2=VALOR
 public HttpResponseMessage Get(string token, int colecao = 0, int campo = 0, int orderBy = 0, int pageSize = 0, int pageNumber = 0)
 {
     try
     {
         Dictionary <string, string> queryString = Request.GetQueryNameValuePairs().ToDictionary(x => x.Key, x => x.Value);
         HttpResponseMessage         retorno     = new HttpResponseMessage();
         if (Permissoes.Autenticado(token))
         {
             return(Request.CreateResponse <Retorno>(HttpStatusCode.OK, GatewayTaxaAdministracao.Get(token, colecao, campo, orderBy, pageSize, pageNumber, queryString)));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.Unauthorized));
         }
     }
     catch
     {
         throw new HttpResponseException(HttpStatusCode.InternalServerError);
     }
 }