Ejemplo n.º 1
0
        private void btnModCat_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Está seguro de modificar?", "Modificación", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                if (textBox1.Text == "")
                {
                    MessageBox.Show("Ingrese la informacion correctamente");
                }
                else
                {
                    ClassColores     Logica         = new ClassColores();
                    MODELS.Categoria claseCategoria = new MODELS.Categoria();

                    int codigo = 0;
                    claseCategoria.CategoriaId = Convert.ToInt32(this.dataGridView1.CurrentRow.Cells[0].Value.ToString());
                    claseCategoria.Nombre      = textBox1.Text;
                    string resp = Logica.ActualizarCategoria(claseCategoria);
                    MessageBox.Show(resp);
                    textBox1.Text = "";
                    MostrarDatos();
                    btnModCat.Visible      = false;
                    btnIngresarCat.Visible = true;
                }
            }
        }