private void validarRegistro(Control container) { if (container != null && beanDataSet != null && beanDataSet.Count > 0) { foreach (Control c in container.Controls) { if (c.Controls.Count > 0) { setValidadores(c); } else { if (c is REFTextBox) { REFTextBox t = (REFTextBox)c; if (t.isDataBaseItem && t.tipo == TipoTextBox.REQUIRED && t.Text == "") { t.Select(); throw new ValueRequiredException("Campo de preenchimento obrigatório."); } } } } } }
protected void validarRegistro(Control container) { if (container != null) { foreach (Control c in container.Controls) { if (c.Controls.Count > 0) { validarRegistro(c); } else { if (c is REFTextBox) { REFTextBox t = (REFTextBox)c; if (t.tipo == TipoTextBox.REQUIRED && t.Text == "") { t.Select(); throw new ValueRequiredException("Campo de preenchimento obrigatório."); } } else if (c is REFComboBox) { REFComboBox t = (REFComboBox)c; if (t.tipo == TipoComboBox.REQUIRED && t.Text == "") { t.Select(); throw new ValueRequiredException("Campo de preenchimento obrigatório."); } } } } } }