private void tlbMenu_NewClick() { try { frmRegVendorEdit objManVendor = new frmRegVendorEdit(); objManVendor.lstVendor = mLista; objManVendor.pOperacion = frmRegVendorEdit.Operacion.Nuevo; objManVendor.IdVendor = 0; objManVendor.StartPosition = FormStartPosition.CenterParent; objManVendor.ShowDialog(); Cargar(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void InicializarModificar() { if (gvVendor.RowCount > 0) { VendorBE objVendor = new VendorBE(); objVendor.IdVendor = int.Parse(gvVendor.GetFocusedRowCellValue("IdVendor").ToString()); frmRegVendorEdit objManVendorEdit = new frmRegVendorEdit(); objManVendorEdit.pOperacion = frmRegVendorEdit.Operacion.Modificar; objManVendorEdit.IdVendor = objVendor.IdVendor; objManVendorEdit.StartPosition = FormStartPosition.CenterParent; objManVendorEdit.ShowDialog(); Cargar(); } else { MessageBox.Show("No se pudo editar"); } }