summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Servicos.Ajuda/AjudaServico.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Servicos.Ajuda/AjudaServico.cs')
-rw-r--r--Decompiler/Gestor.Application.Servicos.Ajuda/AjudaServico.cs114
1 files changed, 114 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Servicos.Ajuda/AjudaServico.cs b/Decompiler/Gestor.Application.Servicos.Ajuda/AjudaServico.cs
new file mode 100644
index 0000000..7805918
--- /dev/null
+++ b/Decompiler/Gestor.Application.Servicos.Ajuda/AjudaServico.cs
@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Threading.Tasks;
+using CsQuery.ExtensionMethods.Internal;
+using Gestor.Application.Helpers;
+using Gestor.Application.Model.Ajuda;
+using Gestor.Application.Servicos.Generic;
+using Gestor.Model.API;
+using Gestor.Model.License;
+
+namespace Gestor.Application.Servicos.Ajuda;
+
+public class AjudaServico : BaseServico
+{
+ internal async Task<ObservableCollection<Atendimento>> BuscarAtendimentos(string status)
+ {
+ return await Task.Run(delegate
+ {
+ try
+ {
+ int num = ((status == "PENDENTES") ? 1 : 2);
+ return Connection.Get<ObservableCollection<Atendimento>>($"Attendance/{num}").Result;
+ }
+ catch (Exception)
+ {
+ return (ObservableCollection<Atendimento>)null;
+ }
+ });
+ }
+
+ internal async Task<string> BuscarCorpoAtendimentos(long id)
+ {
+ return await Task.Run(delegate
+ {
+ try
+ {
+ return Connection.Get<string>($"Attendance/Body/{id}").Result;
+ }
+ catch (Exception)
+ {
+ return (string)null;
+ }
+ });
+ }
+
+ internal async Task<List<Boleto>> BuscarBoletosNotas(string status)
+ {
+ return await Task.Run(delegate
+ {
+ try
+ {
+ return Connection.Get<List<Boleto>>(string.Format("Billet/{0}", status == "BAIXADOS")).Result;
+ }
+ catch (Exception)
+ {
+ return (List<Boleto>)null;
+ }
+ });
+ }
+
+ internal async Task<Contrato> BuscarContrato(Produto produto)
+ {
+ //IL_000e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000f: Unknown result type (might be due to invalid IL or missing references)
+ return await Task.Run(delegate
+ {
+ //IL_0006: Unknown result type (might be due to invalid IL or missing references)
+ try
+ {
+ return Connection.Get<Contrato>($"Contract/{ExtensionMethods.GetValue((Enum)(object)produto)}").Result;
+ }
+ catch (Exception)
+ {
+ return (Contrato)null;
+ }
+ });
+ }
+
+ internal async Task<ObservableCollection<Instalacao>> BuscarLicencas()
+ {
+ return await Task.Run(delegate
+ {
+ try
+ {
+ return Connection.Get<ObservableCollection<Instalacao>>($"License/{ApplicationHelper.IdFornecedor}").Result;
+ }
+ catch (Exception)
+ {
+ return (ObservableCollection<Instalacao>)null;
+ }
+ });
+ }
+
+ internal async Task<bool> ExcluirInstalacao(long id)
+ {
+ int tries = 3;
+ return await Task.Run(delegate
+ {
+ while (tries > 0)
+ {
+ try
+ {
+ return Connection.Delete($"License/{id}").Result;
+ }
+ catch (Exception e)
+ {
+ tries = Registrar(e, (TipoErro)273, tries, id);
+ }
+ }
+ return false;
+ });
+ }
+}