protected void crear(object sender, EventArgs e) { MOL.Categoria c = new MOL.Categoria(); string nuevo = txtCrearCatNombre.Text; int tipo = dropTipos.SelectedIndex; c.Crear(nuevo, tipo); txtCrearCatNombre.Text = null; dropTipos.ClearSelection(); gridCategoria.DataBind(); }
protected void eliminar(object ender, EventArgs e) { MOL.Categoria c = new MOL.Categoria(); int id = int.Parse(lblEliminarCat.Text.ToString()); c.Eliminar(id); lblCatActual.Text = null; txtEditarCat.Text = null; lblEliminarCat.Text = null; ddlEditarTipoCat.ClearSelection(); gridCategoria.DataBind(); }
protected void editar(object ender, EventArgs e) { MOL.Categoria c = new MOL.Categoria(); string nombre = txtEditarCat.Text; int id = int.Parse(lblCatActual.Text); int tipo = ddlEditarTipoCat.SelectedIndex; c.Actualizar(id, nombre, tipo); lblCatActual.Text = null; txtEditarCat.Text = null; lblEliminarCat.Text = null; lblEliminarCat.Visible = false; gridCategoria.DataBind(); }