private void btnEditar_Click(object sender, EventArgs e) { try { DialogResult result; this.Invoke((MethodInvoker) delegate { if (Convert.ToString(dgvRescision.SelectedRows[0].Cells[13].Value) == Util.EstadoInversion.Registrado) { inversion.frmRescisionInversion frm = new inversion.frmRescisionInversion(); frm.frmParentName = this.Name; frm.idRescision = Convert.ToString(dgvRescision.SelectedRows[0].Cells[0].Value); frm.idInversion = Convert.ToString(dgvRescision.SelectedRows[0].Cells[1].Value); frm.Evento = GetEnum.Eventos.edit; frm.mode = frmBase.frmConfirmacionBase.Mode.modal; result = frm.ShowDialog(this); frm.Close(); frm.Dispose(); } else { ucMsgBox1.ShowMessageWarnnig("Solo se puede editar rescisiones en estado Registrado"); } }); } catch (Exception ex) { ucMsgBox1.ShowMessageError("Error al cargar el detalle de la inversión - Error: " + ex.Message); } }
private void openDetailRescision() { if (dgvRescision.SelectedRows.Count > 0) { DataGridViewRow row = dgvRescision.SelectedRows[0]; idRescision = row.Cells[0].Value.ToString(); if (frmParentName == "frmRescisionInversion") { this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } else { DialogResult result; inversion.frmRescisionInversion frm = new inversion.frmRescisionInversion(); frm.frmParentName = this.Name; frm.mode = frmBase.frmConfirmacionBase.Mode.modal; frm.idRescision = idRescision; frm.Evento = GetEnum.Eventos.view; result = frm.ShowDialog(this); if (result == System.Windows.Forms.DialogResult.OK) { listRescision(); } } } else { ucMsgBox1.ShowMessageWarnnig("Debe seleccionar una inversión de la lista"); } }
private void btnNuevo_Click(object sender, EventArgs e) { try { DialogResult result; this.Invoke((MethodInvoker) delegate { inversion.frmRescisionInversion frm = new inversion.frmRescisionInversion(); frm.frmParentName = this.Name; //frm.idInversion = idInversion; frm.Evento = GetEnum.Eventos.insert; frm.mode = frmBase.frmConfirmacionBase.Mode.modal; result = frm.ShowDialog(this); frm.Close(); frm.Dispose(); }); } catch (Exception ex) { ucMsgBox1.ShowMessageError("Error al cargar el detalle de la inversión - Error: " + ex.Message); } }