protected void btnModificar_Click(object sender, EventArgs e) { if (txtNombre.Text == "") { lblMensaje.Text = "Debe ingresar nombre Usuario"; txtNombre.Focus(); return; } if (txtApellido.Text == "") { lblMensaje.Text = "Debe ingresar Apellido Usuario"; txtApellido.Focus(); return; } if (txtCorreo.Text == "") { lblMensaje.Text = "Debe ingresar Email Usuario"; txtCorreo.Focus(); return; } if (txtContraseña.Text == "") { lblMensaje.Text = "Debe ingresar Contraseña Usuario"; txtContraseña.Focus(); return; } lblMensaje.Text = CADUsuario.CADUsu.ActualizarUsuario(txtNombre.Text, txtApellido.Text, txtCorreo.Text, txtContraseña.Text, Convert.ToInt16(txtIDUsuario.Text)); GVUsuario.DataBind(); }
protected void btnNuevo_Click(object sender, EventArgs e) { if (txtNombre.Text == "") { lblMensaje.Text = "Debe ingresar nombre Usuario"; txtNombre.Focus(); return; } if (txtApellido.Text == "") { lblMensaje.Text = "Debe ingresar Apellido Usuario"; txtApellido.Focus(); return; } if (txtCorreo.Text == "") { lblMensaje.Text = "Debe ingresar Email Usuario"; txtCorreo.Focus(); return; } if (txtContraseña.Text == "") { lblMensaje.Text = "Debe ingresar Contraseña Usuario"; txtContraseña.Focus(); return; } lblMensaje.Text = CADUsuario.CADUsu.NuevoCliente(txtNombre.Text, txtApellido.Text, txtCorreo.Text, txtContraseña.Text); GVUsuario.DataBind(); }
public void listagridN() { Conexao Con = new Conexao(); string usu = textBoxUsuario.Text; if (!Con.Checkconection()) { Con.Conectar(); } if (Con.Checkconection()) { GVUsuario.DataSource = null; DataTable table = new DataTable(); MySqlDataAdapter adapter = new MySqlDataAdapter(); MySqlCommand command = new MySqlCommand("SELECT * FROM USUARIO", Con.Traz_Conexao()); adapter.SelectCommand = command; adapter.Fill(table); GVUsuario.DataSource = table; GVUsuario.Update(); GVUsuario.Refresh(); Con.Desconectar(); } }
public void listagridP() { Conexao Con = new Conexao(); string usu = textBoxUsuario.Text; if (!Con.Checkconection()) { Con.Conectar(); } if (Con.Checkconection()) { GVUsuario.DataSource = null; DataTable table = new DataTable(); MySqlDataAdapter adapter = new MySqlDataAdapter(); MySqlCommand command = new MySqlCommand("SELECT * FROM USUARIO WHERE USUARIO = @usuario", Con.Traz_Conexao()); command.Parameters.Add("@usuario", MySqlDbType.VarChar).Value = (usu); adapter.SelectCommand = command; adapter.Fill(table); GVUsuario.DataSource = table; GVUsuario.Update(); GVUsuario.Refresh(); Con.Desconectar(); } }
protected void btnEliminar_Click(object sender, EventArgs e) { lblMensaje.Text = CADUsuario.CADUsu.BorrarUsuario(Convert.ToInt16(txtIDUsuario.Text)); txtIDUsuario.Text = ""; txtNombre.Text = ""; txtApellido.Text = ""; txtCorreo.Text = ""; txtContraseña.Text = ""; GVUsuario.DataBind(); }
private void CargarGVUsuario() { try { ObjectDataSource1.SelectParameters.Clear(); ObjectDataSource1.SelectParameters.Add(new Parameter() { Name = "conexion", DefaultValue = System.Configuration.ConfigurationManager.ConnectionStrings["Concurso"].ToString() }); GVUsuario.DataBind(); } catch { Response.Write("<script>alert('Ha ocurrido un error inesperado, si el problema persiste por favor contáctese con un administrador');</script>"); } }
private void BindGridUsuario() { GVUsuario.DataSource = GetAllUsuario(); GVUsuario.DataBind(); }