private void txtBxDescricao_KeyPress(object sender, KeyPressEventArgs e) { if (txtBxDescricao.Text == string.Empty) { ErrPrvdrStatus.SetError(txtBxDescricao, ValidationsMessages.VALIDA_CAMPO_VAZIO); tlstrpActionMenuBtnConfirm.Enabled = false; } else { ErrPrvdrStatus.SetError(txtBxDescricao, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; } }
private void txtBxCodigo_KeyPress(object sender, KeyPressEventArgs e) { if (txtBxCodigo.Text == string.Empty) { ErrPrvdrStatus.SetError(txtBxCodigo, ValidationsMessages.VALIDA_CAMPO_VAZIO); tlstrpActionMenuBtnConfirm.Enabled = false; } else { ErrPrvdrStatus.SetError(txtBxCodigo, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; if (!ValidationData.CreateInstance.ValidaAceiteSomenteNumeros(txtBxCodigo.Text)) { ErrPrvdrStatus.SetError(txtBxCodigo, ValidationsMessages.VALIDA_CODIGO); tlstrpActionMenuBtnConfirm.Enabled = false; } else { ErrPrvdrStatus.SetError(txtBxCodigo, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; } } }