Example #1
0
        protected void btnCadastrarUsuario(object sender, EventArgs e)
        {
            try
            {
                Usuario u = new Usuario();

                u.Nome  = txtNome.Text;
                u.Email = txtEmail.Text;
                u.Senha = txtSenha.Text;

                UsuarioDAL ud = new UsuarioDAL();

                ud.CadastrarUsu(u); //Gravando a pessoa

                lblMensagem.Text = "Usuário " + u.Nome + " cadastrado com Sucesso.";

                txtNome.Text  = string.Empty;
                txtEmail.Text = string.Empty;
                txtSenha.Text = string.Empty;
            }
            catch (Exception ex)
            {
                lblMensagem.Text = ex.Message;
            }
        }