Пример #1
0
        private void botonEliminar_Click(object sender, EventArgs e)
        {
            Int32 selectedRowCount =
                dataGridView1.Rows.GetRowCount(DataGridViewElementStates.Selected);

            if (selectedRowCount > 0)
            {
                if (MessageBox.Show("Estás seguro de eliminar esta factura?", "Tender Amount",
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Factura fact = new Factura();
                    fact.FacturaEliminar(int.Parse(dataGridView1.SelectedRows[0].Cells["facturaID"].Value.ToString()));
                    LlenarGrid();
                }
            }
        }
Пример #2
0
        private void buttonEliminar_Click(object sender, EventArgs e)
        {
            EliminarConfirmar ec = new EliminarConfirmar();

            ec.ShowDialog();
            if (ec.Eliminar)
            {
                Factura fact = new Factura();
                fact.FacturaEliminar(int.Parse(dataGridView1.SelectedRows[0].Cells["facturaID"].Value.ToString()));
            }
            ec.Dispose();
            ec.Close();

            this.Controls.Clear();
            this.InitializeComponent();
            LlenarGrid();
            panel1.Visible = false;
        }