public async Task <VersaoPluginDto> GetVersaoAsync() { PluginRepository pluginRepository = new PluginRepository(_authentication, EndPointsAPI.ControleVersao); var versao = await pluginRepository.Get <VersaoPluginDto>(); return(versao); }
public async Task <List <DeParaBeneficiadorDto> > BeneficiadorDeParaGetAsync() { Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("idclient", _authentication.CurrentClient); parameters.Add("UserName", _authentication.userName); PluginRepository pluginRepository = new PluginRepository(_authentication, EndPointsAPI.ClientPlaceDeParaGet); var campos = await pluginRepository.Get <List <DeParaBeneficiadorDto> >(parameters); return(campos); }
public async Task <bool> ValidaVersao() { decimal versaoAtual = decimal.Parse(ConfigurationManager.AppSettings["Version"]); PluginRepository pluginRepository = new PluginRepository(_authentication, EndPointsAPI.ControleVersao); var versao = await pluginRepository.Get <VersaoPluginDto>(); if (versaoAtual >= versao.minimaVersao) { return(true); } else { return(false); } }
public async Task <SalesDto> GetInformationFieldsPlan(string codCliente) { PluginRepository pluginRepository = new PluginRepository(_authentication, EndPointsAPI.ClientFieldsGet); Dictionary <string, string> keyValues = new Dictionary <string, string>(); keyValues.Add("idUser", _authentication.userName); keyValues.Add("idclient", codCliente); try { var campos = await pluginRepository.Get <List <SalesDto> >(keyValues).ConfigureAwait(false); return(campos.Where(p => p.Active == true).FirstOrDefault()); } catch (Exception ex) { if (ex.Message.ToLower().Contains("não existem dados")) { return(null); } throw new Exception(ex.Message); } }