Ejemplo n.º 1
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            if (edtUsername.Text == "")
            {
                Toast Meutoast;
                Meutoast = Toast.MakeText(this, "Preencha campo Usuario", ToastLength.Short);
                Meutoast.Show();
            }
            if (edtPassword.Text == string.Empty)
            {
                Toast Meutoast;
                Meutoast = Toast.MakeText(this, "Preencha campo Senha", ToastLength.Long);
                Meutoast.Show();
                return;
            }
            bool existe = controlador.UsuarioExiste(edtUsername.Text, edtPassword.Text);

            if (existe)
            {
                Toast Meutoast;
                Meutoast = Toast.MakeText(this, "Bem Vindo", ToastLength.Short);
                Meutoast.Show();
            }
            else
            {
                Toast MeuToast;
                MeuToast = Toast.MakeText(this, "Usuario ou senha invalido", ToastLength.Short);
                MeuToast.Show();
            }
        }