public void InserirLancamentoFinaneiro(LancamentoFinanceiroApiModel model) { try { var dados = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json"); using (var response = _httpClient.PostAsync(ClientServiceHelpers.ConfigurarUrl(_customConfiguration, "PostLancamentoFinanceiro"), dados)) { var retornoApi = response.Result.Content.ReadAsStringAsync(); } } catch (Exception) { throw; } }
public IEnumerable <BalancoMensalModel> GetBalancoMensal(int?ano, int?mes) { try { using (var response = _httpClient.GetAsync(ClientServiceHelpers.ConfigurarUrl(_customConfiguration, Servicos.SERVICO_BALANCO_MENSAL))) { var retornoApi = response.Result.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <List <BalancoMensalModel> >(retornoApi.Result)); } } catch (Exception) { throw; } }
public void ExcluirLancamentoFinanceiro(int id) { try { var urlComParametros = $"{ClientServiceHelpers.ConfigurarUrl(_customConfiguration, "DeleteLancamentoFinanceiro")}/{id}"; using (var response = _httpClient.DeleteAsync(urlComParametros)) { var retornoApi = response.Result.Content.ReadAsStringAsync(); } } catch (Exception) { throw; } }
public void AtualizarLancamentoFinanceiro(LancamentoFinanceiroApiUpdateModel model) { try { var dados = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json"); using (var response = _httpClient.PutAsync(ClientServiceHelpers.ConfigurarUrl(_customConfiguration, Servicos.SERVICO_ATUALIZAR_LANCAMENTO_FINANCEIRO), dados)) { var retornoApi = response.Result.Content.ReadAsStringAsync(); } } catch (Exception) { throw; } }
public void GerarBalancoDiario() { try { var encodedContent = new FormUrlEncodedContent(new Dictionary <string, string> { }); using (var response = _httpClient.PostAsync(ClientServiceHelpers.ConfigurarUrl(_customConfiguration, Servicos.SERVICO_BALANCO_DIARO), new StringContent(""))) { response.Result.Content.ReadAsStringAsync(); } } catch (Exception) { throw; } }
public LancamentoFinanceiroModel GetLancamentoFinanceiro(int id) { try { var urlComParametros = $"{ClientServiceHelpers.ConfigurarUrl(_customConfiguration, "GetLancamentoFinanceiro")}/{id}"; using (var response = _httpClient.GetAsync(urlComParametros)) { var retornoApi = response.Result.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <LancamentoFinanceiroModel>(retornoApi.Result)); } } catch (Exception) { throw; } }
public IEnumerable <LancamentoFinanceiroModel> FiltrarLancamentosFinanceiro(LancamentoFinanceiroFiltro filtro) { try { var urlComParametros = $"{ClientServiceHelpers.ConfigurarUrl(_customConfiguration, "GetListaLancamentoFinanceiro")}?" + $"DataLancamento={filtro.DataLancamento}&" + $"TipoLancamento={filtro.TipoLancamento}&" + $"Conciliado={filtro.Conciliado}"; using (var response = _httpClient.GetAsync(urlComParametros)) { var retornoApi = response.Result.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <List <LancamentoFinanceiroModel> >(retornoApi.Result)); } } catch (Exception) { throw; } }