Пример #1
0
        private async Task Init()
        {
            try
            {
                InitLoad();
                var assembly = Assembly.GetExecutingAssembly();
                lblVersion.Text = assembly.GetName().Version.ToString(3);

                var sett = Settings.Default;
                UriProvider.IsProveedor = sett.EsProveedor;
                if (string.IsNullOrWhiteSpace(sett.Ruc) ||
                    string.IsNullOrWhiteSpace(sett.Usuario) ||
                    string.IsNullOrWhiteSpace(sett.Clave))
                {
                    InvokeOnClick(btnSetting, null);
                    return;
                }

                _auth = new SunatApi(sett.Ruc, sett.Usuario, sett.Clave);
                _auth.Login();
                await Extractor()
                .ConfigureAwait(false);
            }
            catch (Exception e)
            {
                Error(e.Message);
            }
            Invoke(new MethodInvoker(() => spinner.Visible = false));
        }
Пример #2
0
 /// <summary>
 /// Logins the test.
 /// </summary>
 //[TestInitialize]
 public void LoginTest()
 {
     _auth.Login();
 }