// GET /TB_UNIVERSIDADE_TAG/token/colecao/campo/orderBy/pageSize/pageNumber?CAMPO1=VALOR&CAMPO2=VALOR public Retorno Get(string token, int colecao = 0, int campo = 0, int orderBy = 0, int pageSize = 0, int pageNumber = 0) { try { ModelApiUnes _db = new ModelApiUnes(); Dictionary <string, string> queryString = Request.GetQueryNameValuePairs().ToDictionary(x => x.Key, x => x.Value); Retorno dados = GatewayTbUniversidadeTag.Get(token, colecao, campo, orderBy, pageSize, pageNumber, queryString, _db); return(dados); } catch (Exception e) { throw new Exception(e.Message); } }
public void Delete(string token, Int64 id) { // Abre nova conexão using (ModelApiUnes _db = new ModelApiUnes()) { try { if (Permissoes.Autenticado(token, _db)) { GatewayTbUniversidadeTag.Delete(token, id, _db); } //else //return new Retorno() { Token = false }; //throw new Exception("Unauthorized"); } catch (Exception e) { throw new Exception(e.Message); } } }
public void Put(string token, [FromBody] TB_UNIVERSIDADE_TAG param) { // Abre nova conexão using (ModelApiUnes _db = new ModelApiUnes()) { try { if (Permissoes.Autenticado(token, _db)) { GatewayTbUniversidadeTag.Update(token, param, _db); } //else //return new Retorno() { Token = false }; //throw new Exception("Unauthorized"); } catch (Exception e) { throw new Exception(e.Message); } } }
public Int64 Post(string token, [FromBody] TB_UNIVERSIDADE_TAG param) { // Abre nova conexão using (ModelApiUnes _db = new ModelApiUnes()) { try { if (Permissoes.Autenticado(token, _db)) { Int64 dados = GatewayTbUniversidadeTag.Add(token, param, _db); return(dados); } else { return(0);// new Retorno() { Token = false }; //throw new Exception("Unauthorized"); } } catch (Exception e) { throw new Exception(e.Message); } } }