private void btnNew_Click(object sender, EventArgs e) { Agregar agregarDevolucion = new Agregar(null); Tag = "I"; //ESTABLECE EL TAG EN OPCION I PARA DEFINIR QUE SE ESTA AGREGANDO UN REGISTRO. agregarDevolucion.BringToFront(); agregarDevolucion.FormClosed += new FormClosedEventHandler(A_FormClosed); agregarDevolucion.Show(); }
private void tblDevolucionesFilter_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex >= 0) { CEAsignaciones asignacion = new CEAsignaciones { id = Convert.ToInt32(tblDevolucionesFilter.Rows[e.RowIndex].Cells["NUMERO"].Value), documento = tblDevolucionesFilter.Rows[e.RowIndex].Cells["DOCUMENTO"].Value.ToString(), nombreCompleto = tblDevolucionesFilter.Rows[e.RowIndex].Cells["NOMBRES"].Value.ToString(), fecha = tblDevolucionesFilter.Rows[e.RowIndex].Cells["FECHA"].Value.ToString(), asiTeclado = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["TECLADO"].Value), asiMouse = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["MOUSE"].Value), asiPuesto = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["PUESTO"].Value), asiBase = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["BASE"].Value), asiMaletin = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["MALETIN"].Value), asiMorral = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["MORRAL"].Value), asiCorreo = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["CORREO"].Value), anulado = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["ANULADO"].Value), observacion = tblDevolucionesFilter.Rows[e.RowIndex].Cells["OBSERVACIONES"].Value.ToString(), fechaModifi = tblDevolucionesFilter.Rows[e.RowIndex].Cells["FECHAMODIFI"].Value.ToString(), usuarioModifi = tblDevolucionesFilter.Rows[e.RowIndex].Cells["USUMODIFI"].Value.ToString() }; Agregar A = new Agregar(asignacion); A.TopLevel = false; A.Dock = DockStyle.None; Controls.Add(A); Tag = "C"; // ESTABLECE EL TAG EN MODO CONSULTA PARA NO VOLVER A CARGAR LA DATA A LA TABLA. A.Location = new Point(50, 50); A.BringToFront(); A.FormClosed += new FormClosedEventHandler(A_FormClosed); A.Show(); } } catch (Exception ex) { MessageBox.Show("" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }