Esempio n. 1
0
        //Metodo utilizado pelos botões de entrar na tela e no appbar. Apenas pra não repetir código.
        private void Entrar(object sender, EventArgs e)
        {
            string usuario = LoginInput.Text;
            string senha   = PasswordInput.Password;

            if (string.IsNullOrEmpty(usuario) || string.IsNullOrEmpty(senha))
            {
                MessageBox.Show("Favor entrar com o nome de usuário e senha");
            }
            else
            {
                string hash = Hash.hashing(senha);
                //MessageBox.Show(hash);

                SacisService.Service1SoapClient WService = new SacisService.Service1SoapClient();

                try
                {
                    WService.consultaUsuarioAsync(usuario, hash);
                    WService.consultaUsuarioCompleted += new EventHandler <consultaUsuarioCompletedEventArgs>(consultaUsuarioCompleted);
                    showSystemTray(true);
                }
                catch (Exception)
                {
                    MessageBox.Show("Falha de comunicação com o servidor do SACIS.");
                }
            }
        }
Esempio n. 2
0
        //Metodo utilizado pelos botões de entrar na tela e no appbar. Apenas pra não repetir código.
        private void Entrar(object sender, EventArgs e)
        {
            string usuario = LoginInput.Text;
            string senha = PasswordInput.Password;
            if (string.IsNullOrEmpty(usuario) || string.IsNullOrEmpty(senha))
                MessageBox.Show("Favor entrar com o nome de usuário e senha");
            else
            {
                string hash = Hash.hashing(senha);
                //MessageBox.Show(hash);

                SacisService.Service1SoapClient WService = new SacisService.Service1SoapClient();

                try
                {
                    WService.consultaUsuarioAsync(usuario, hash);
                    WService.consultaUsuarioCompleted += new EventHandler<consultaUsuarioCompletedEventArgs>(consultaUsuarioCompleted);
                    showSystemTray(true);
                }
                catch (Exception)
                {
                    MessageBox.Show("Falha de comunicação com o servidor do SACIS.");
                }

            }
        }
 private void btnConfirmar_Click(object sender, EventArgs e)
 {
     if (app.isAuthenticated)
     {
         string login = app.User;
         string hash = Hash.hashing(Password.Password);
         SacisService.Service1SoapClient WService = new SacisService.Service1SoapClient();
         WService.alteraSenhaAsync(login, hash);
         WService.alteraSenhaCompleted += new EventHandler<alteraSenhaCompletedEventArgs>(alteraSenhaCompleted);
     }
     else
     {
         MessageBox.Show("Erro inesperado");
     }
 }
 private void btnConfirmar_Click(object sender, EventArgs e)
 {
     if (app.isAuthenticated)
     {
         string login = app.User;
         string hash  = Hash.hashing(Password.Password);
         SacisService.Service1SoapClient WService = new SacisService.Service1SoapClient();
         WService.alteraSenhaAsync(login, hash);
         WService.alteraSenhaCompleted += new EventHandler <alteraSenhaCompletedEventArgs>(alteraSenhaCompleted);
     }
     else
     {
         MessageBox.Show("Erro inesperado");
     }
 }