예제 #1
0
 public static async Task <HttpResponseMessage> AtualizarDestinatarioDAO(Destinatario destinatario)
 {
     try
     {
         return(await AbstractCrud.Update(destinatario, "destinatario", destinatario.Id));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel atualizar esse destinatario. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi atualizar deletar esse destinatario.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel atualizar esse destinatario. Erro: " + ex.Message);
     }
 }
예제 #2
0
 /// <summary>
 /// AdicionarEmiente - Adicionar/Cadastra um novo Destinatario
 /// </summary>
 /// <param name="destinatario"></param>
 /// <returns></returns>
 public static async Task <HttpResponseMessage> AdicionarDestinatarioDAO(Destinatario destinatario)
 {
     try
     {
         return(await AbstractCrud.Add(destinatario, "destinatario"));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel salvar esse destinatario. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi possivel salvar esse destinatario.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel salvar esse destinatario. Erro: " + ex.Message);
     }
 }
예제 #3
0
 /// <summary>
 /// DeltarDestinatario - Excluir um destinatario
 /// </summary>
 /// <param name="id">id do Destinatario</param>
 /// <returns></returns>
 public static async Task <HttpResponseMessage> DeletarDestinatarioDAO(int id)
 {
     try
     {
         return(await AbstractCrud.Delete(id, "destinatario"));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel deletar esse destinatario. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi possivel deletar esse destinatario.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel deletar esse destinatario. Erro: " + ex.Message);
     }
 }
 /// <summary>
 /// Atualizar/Editar um produto
 /// </summary>
 /// <param name="produto"></param>
 /// <returns></returns>
 public static async Task <HttpResponseMessage> AtualizarProdutoDAO(Produto produto)
 {
     try
     {
         return(await AbstractCrud.Update(produto, "produto", produto.Id));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel atualizar esse produto. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi atualizar deletar esse produto.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel atualizar esse produto. Erro: " + ex.Message);
     }
 }
예제 #5
0
 /// <summary>
 /// GetDestinatario - Buscar/Listar TODOS os Destinatarios
 /// </summary>
 /// <returns></returns>
 public static async Task <List <Destinatario> > GetDestinatarioDAO()
 {
     try
     {
         return(await AbstractCrud.GetAll <Destinatario>("destinatario"));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel buscar os Destinatarios. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi possivel buscar os Destinatarios. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel buscar os Destinatarios. Erro: " + ex.Message);
     }
 }
예제 #6
0
 public static async Task <HttpResponseMessage> AtualizarEmitenteDAO(Emitente emitente)
 {
     try
     {
         return(await AbstractCrud.Update(emitente, "emitente", emitente.Id));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel atualizar esse emitente. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi atualizar deletar esse emitente.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel atualizar esse emitente. Erro: " + ex.Message);
     }
 }
 /// <summary>
 /// Cadatrar um novo produto
 /// </summary>
 /// <param name="produto"></param>
 /// <returns></returns>
 public static async Task <HttpResponseMessage> AdicionarProdutoDAO(Produto produto)
 {
     try
     {
         return(await AbstractCrud.Add(produto, "produto"));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel salvar esse produto. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi possivel salvar esse produto.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel salvar esse produto. Erro: " + ex.Message);
     }
 }
예제 #8
0
 /// <summary>
 /// AdicionarEmiente - Adicionar/Cadastra um novo Emitente
 /// </summary>
 /// <param name="emitente"></param>
 /// <returns></returns>
 public static async Task <HttpResponseMessage> AdicionarEmitenteDAO(Emitente emitente)
 {
     try
     {
         return(await AbstractCrud.Add(emitente, "emitente"));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel salvar esse emitente. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi possivel salvar esse emitente.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel salvar esse emitente. Erro: " + ex.Message);
     }
 }
예제 #9
0
 /// <summary>
 /// GetEmitente - Buscar/Listar TODOS os Emitentes
 /// </summary>
 /// <returns></returns>
 public static async Task <List <Emitente> > GetEmitenteDAO()
 {
     try
     {
         return(await AbstractCrud.GetAll <Emitente>("emitente"));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel buscar os Emitentes. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi possivel buscar os Emitentes. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel buscar os Emitentes. Erro: " + ex.Message);
     }
 }
 public static async Task <HttpResponseMessage> AtualizarTransportadorDAO(Transportador transportador)
 {
     try
     {
         return(await AbstractCrud.Update(transportador, "transportador", transportador.Id));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel atualizar esse transportador. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi atualizar deletar esse transportador.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel atualizar esse transportador. Erro: " + ex.Message);
     }
 }
 /// <summary>
 /// AdicionarEmiente - Adicionar/Cadastra um novo Transportador
 /// </summary>
 /// <param name="transportador"></param>
 /// <returns></returns>
 public static async Task <HttpResponseMessage> AdicionarTransportadorDAO(Transportador transportador)
 {
     try
     {
         return(await AbstractCrud.Add(transportador, "transportador"));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel salvar esse transportador. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi possivel salvar esse transportador.. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel salvar esse transportador. Erro: " + ex.Message);
     }
 }
 /// <summary>
 /// GetTransportador - Buscar/Listar TODOS os Transportadors
 /// </summary>
 /// <returns></returns>
 public static async Task <List <Transportador> > GetTransportadorDAO()
 {
     try
     {
         return(await AbstractCrud.GetAll <Transportador>("transportador"));
     }
     catch (JsonException ex)
     {
         throw new Exception("JsonException - Não foi possivel buscar os Transportadors. Erro: " + ex.Message);
     }
     catch (HttpRequestException ex)
     {
         throw new Exception("HttpRequestException - Não foi possivel buscar os Transportadors. Erro: " + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("Exception - Não foi possivel buscar os Transportadors. Erro: " + ex.Message);
     }
 }