Пример #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            string errors = "";

            if (txtUsuario.Text.ToString() == "")
            {
                errors += " - Preencha o campo \"Usuário\"\n";
            }

            if (txtSenha.Text.ToString() == "")
            {
                errors += " - Preencha o campo \"Senha\"\n";
            }

            if (errors.ToString() != "")
            {
                MessageBox.Show("Ocorreram os seguintes erros:\n\n" + errors.ToString(), "Erro");
            }
            else
            {
                if (Session.Session.Auth(txtUsuario.Text.ToString(), txtSenha.Text.ToString()))
                {
                    mdiPrincipal Frm = new mdiPrincipal();
                    Frm.Show();
                    this.Visible = false;
                }
                else
                {
                    MSGLOGINERRO();
                }
            }
        }