Esempio n. 1
0
        public static int CadastroUser(CadastroUser cad)
        {
            int             resultado;
            CadastroUserDao dao = new CadastroUserDao();

            return(resultado = dao.CadastroUsuario(cad));
        }
Esempio n. 2
0
        private void BtnTelaCadastrarUser_Click(object sender, EventArgs e)
        {
            int            resultado;
            ControlerLogin log     = new ControlerLogin();
            CadastroUser   cadUser = new CadastroUser();

            cadUser.userName = TxtNomeUsuarioCadastro.Text;
            cadUser.password = TxtSenhaUsuarioCadastro.Text;

            if ((TxtConfirmarSenhaCadastro.Text.Length != 0) && (TxtNomeUsuarioCadastro.Text.Length != 0) && (TxtSenhaUsuarioCadastro.Text.Length != 0))
            {
                if (TxtSenhaUsuarioCadastro.Text == TxtConfirmarSenhaCadastro.Text)
                {
                    resultado = log.CadastroUser(cadUser);

                    if (resultado != 0)
                    {
                        MessageBox.Show("Cadastro bem sucedido");
                    }
                }
                else
                {
                    MessageBox.Show("As senhas devem ser iguais");
                }
            }
            else
            {
                MessageBox.Show("Você deve preencher todos os campos");
            }
        }