예제 #1
0
        protected void btnSi_Click(object sender, EventArgs e)
        {
            int idProducto = Convert.ToInt32(dgv.Rows[dgv.SelectedIndex].Cells[1].Text);

            if (!LNyAD.ExisteProductoEnCompra(idProducto))
            {
                LNyAD.EliminarProducto(idProducto);

                CargaProductos();

                MostrarConfirmacion(false);

                dgv.SelectedIndex = -1;
            }
            else
            {
                MostrarConfirmacion(false);
                lbNoBorrar.Text   = "No puede borrar el producto " + dgv.SelectedRow.Cells[2].Text + " porque existe en compras";
                dgv.SelectedIndex = -1;
                return;
            }
        }