private bool VerificarDatos() { if (txtNombre.Text == string.Empty) { errorProvider1.SetError(txtNombre, "Ingrese un dato."); txtNombre.Focus(); return(false); } aeMen.Name = txtNombre.Text; aeMen.NameCode = txtCodigo.Text; try { aeMen.IdApplication = Convert.ToInt32(txtIdAplicacion.Text); } catch (Exception) { errorProvider1.SetError(txtIdAplicacion, "Ingrese un dato del tipo entero."); txtIdAplicacion.Focus(); return(false); } try { aeMen.Level = Convert.ToInt32(txtLevel.Text); } catch (Exception) { errorProvider1.SetError(txtLevel, "Ingrese un dato del tipo entero."); txtLevel.Focus(); return(false); } aeMen.IdParent = cboPadre.SelectedValue == null? 0:Convert.ToInt32(cboPadre.SelectedValue); aeMen.Estate = chkEstado.Checked; aeMen.UserUpdate = "Admin"; error = null; aeMen.DateUpdate = ManagerUtil.getDateTimeServer(ref error); if (error != null) { MetroMessageBox.Show(this, error, "ATENCION!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } return(true); }