Beispiel #1
0
 private void tlbMenu_NewClick()
 {
     try
     {
         frmRegClientEdit objManClient = new frmRegClientEdit();
         objManClient.lstClient     = mLista;
         objManClient.pOperacion    = frmRegClientEdit.Operacion.Nuevo;
         objManClient.IdClient      = 0;
         objManClient.StartPosition = FormStartPosition.CenterParent;
         objManClient.ShowDialog();
         Cargar();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
        public void InicializarModificar()
        {
            if (gvClient.RowCount > 0)
            {
                ClientBE objClient = new ClientBE();

                objClient.IdClient = int.Parse(gvClient.GetFocusedRowCellValue("IdClient").ToString());

                frmRegClientEdit objManClientEdit = new frmRegClientEdit();
                objManClientEdit.pOperacion    = frmRegClientEdit.Operacion.Modificar;
                objManClientEdit.IdClient      = objClient.IdClient;
                objManClientEdit.StartPosition = FormStartPosition.CenterParent;
                objManClientEdit.ShowDialog();

                Cargar();
            }
            else
            {
                MessageBox.Show("No se pudo editar");
            }
        }