Пример #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     ofrmEmpleados.ShowDialog();
 }
        private void datos_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (entro)
            {
                this.entro = false;
                return;
            }

            int c = e.RowIndex;

            if (c == -1)
            {
                return;
            }
            DataGridViewRow row = datos.Rows[c];

            if (e.ColumnIndex == 3)
            {
                return;
            }
            // OBTINE DATOS DE LA POSICIÓN DE LA OPERACIÓN
            MCgrid  = Convert.ToString(row.Cells[0].Value);
            rfcgrid = Convert.ToString(row.Cells[1].Value);
            idgrid  = Convert.ToString(row.Cells[4].Value);
            //



            //
            if ((MCgrid == "C" || MCgrid == "I") || (MCgrid == "F" && chkFusion.Checked))
            {
                frmEmpleados c_aporta = new frmEmpleados();
                c_aporta.enviar = llenacampos;
                c_aporta.ShowDialog();

                // POCISIONA

                int iColumn = datos.CurrentCell.ColumnIndex;
                int iRow    = datos.CurrentCell.RowIndex;
                if (iColumn == datos.ColumnCount - 1)
                {
                    if (datos.RowCount > (iRow + 1))
                    {
                        datos.CurrentCell = datos[1, iRow + 1];
                    }
                }
                else
                {
                    this.entro              = true;
                    datos.CurrentCell       = datos[iColumn + 1, iRow];
                    datos.CurrentCell       = datos.CurrentRow.Cells[3];
                    datos.CurrentCell.Value = rfcnuevo;
                }
            }

            if (MCgrid == "N")
            {
                int iColumn = datos.CurrentCell.ColumnIndex;
                int iRow    = datos.CurrentCell.RowIndex;
                if (iColumn == datos.ColumnCount - 1)
                {
                    if (datos.RowCount > (iRow + 1))
                    {
                        datos.CurrentCell = datos[1, iRow + 1];
                    }
                    else
                    {
                        //focus next control
                    }
                }
                else
                {
                    this.entro        = true;
                    datos.CurrentCell = datos[iColumn + 1, iRow];
                    datos.CurrentCell = datos.CurrentRow.Cells[3];
                    // datos.CurrentCell.Value = rfcnuevo;
                }
            }
        }
Пример #3
0
 private void empleadosToolStripMenuItem_Click(object sender, EventArgs e)
 {
     empleado.ShowDialog();
 }