示例#1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            string documento = txtDocumento.Text;
            string correo    = txtEmail.Text;
            string nombre    = txtNombre.Text;
            string direccion = txtDireccion.Text;
            string telefono  = txtTelefono.Text;

            int Registro = ClUsuario.AgregarUsuario(documento, correo, nombre, direccion, telefono);

            if (Registro == 1)
            {
                Response.Write("<script>alert('Usuario ya existe')</script>");
            }
            else if (Registro == 2)
            {
                Response.Write("<script>alert('Ocurrió un error al registrarse')</script>");
            }
            else if (Registro == 3)
            {
                Response.Write("<script>alert('Usuario registrado con éxito')</script>");
            }

            Limpiar();
        }
示例#2
0
 protected void Lista()
 {
     gvPersonas.DataSource = ClUsuario.ListaClientes();
     gvPersonas.DataBind();
 }