Пример #1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                FormRegistroCategoria ct = new FormRegistroCategoria();
                ct.txtCodigoCategoria.Text      = dataGridView1.CurrentRow.Cells[0].Value.ToString();
                ct.txtNombreCategoria.Text      = dataGridView1.CurrentRow.Cells[1].Value.ToString();
                ct.txtDescriptionCategoria.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString();

                if (dataGridView1.SelectedRows.Count > 0)
                {
                    Program.Evento = 1;
                }
                else
                {
                    Program.Evento = 0;
                }

                ct.ShowDialog();
                dataGridView1.ClearSelection();
                CargarListado();
            }
            else
            {
                MessageBox.Show("Debe Seleccionar la Fila a Editar.", "Sistema de Facturacion.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #2
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            FormRegistroCategoria C = new FormRegistroCategoria();

            if (dataGridView1.SelectedRows.Count > 0)
            {
                Program.Evento = 1;
            }
            else
            {
                Program.Evento = 0;
            }
            dataGridView1.ClearSelection();
            C.ShowDialog();
            CargarListado();
        }