private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                DataGridViewRow row       = this.dataGridView_Lista.Rows[e.RowIndex];
                string          idcompra  = row.Cells["iidCompra"].Value.ToString();
                string          Procesado = row.Cells["Procesado"].Value.ToString();
                if (Procesado == "SI")
                {
                    MessageBox.Show("No puede editar una compra ya ingresada");
                    return;
                }

                Formularios.Inventarios.Form_Compra frm = new Formularios.Inventarios.Form_Compra(idcompra);
                frm.CargaListaAll += new Form1.MessageHandler(CargaListaAll);
                frm.ShowDialog();
            }
        }
        private void toolStripButton_Editar_Click(object sender, EventArgs e)
        {
            int    contador        = 0;
            string IdRegistro      = "";
            string StatusProcesado = "";

            dataGridView_Lista.EndEdit();
            foreach (DataGridViewRow registro in dataGridView_Lista.Rows)
            {
                try
                {
                    if ((Boolean)registro.Cells["Seleccionar"].Value == true)
                    {
                        contador++;
                        IdRegistro      = registro.Cells["iidCompra"].Value.ToString();
                        StatusProcesado = registro.Cells["Procesado"].Value.ToString();
                    }
                }
                catch { }
            }

            if (contador != 1)
            {
                MessageBox.Show("Solo puede seleccionar solo un registro");
            }

            if (StatusProcesado == "SI")
            {
                MessageBox.Show("No puede editar una compra ya ingresada");
                return;
            }



            Formularios.Inventarios.Form_Compra frm = new Formularios.Inventarios.Form_Compra(IdRegistro);
            frm.CargaListaAll += new Form1.MessageHandler(CargaListaAll);
            frm.ShowDialog();
        }
 private void toolStripButton_Add_Click(object sender, EventArgs e)
 {
     Formularios.Inventarios.Form_Compra frm = new Formularios.Inventarios.Form_Compra("");
     frm.CargaListaAll += new Form1.MessageHandler(CargaListaAll);
     frm.ShowDialog();
 }