private void txtBxDescricao_KeyPress(object sender, KeyPressEventArgs e) { if (txtBxDescricao.Text == string.Empty) { ErrPrvdrNatureza.SetError(txtBxDescricao, ValidationsMessages.VALIDA_CAMPO_VAZIO); tlstrpActionMenuBtnConfirm.Enabled = false; } else { ErrPrvdrNatureza.SetError(txtBxDescricao, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; } }
private void tlstrpActionMenuBtnConfirm_Click(object sender, System.EventArgs e) { ExecuteModifyNatureza(); if (txtBxDescricao.Text == string.Empty) { ErrPrvdrNatureza.SetError(txtBxDescricao, ValidationsMessages.VALIDA_CAMPO_VAZIO); tlstrpActionMenuBtnConfirm.Enabled = false; tlstrpLblError.Visible = true; txtBxDescricao.Focus(); return; } if (_IdExcepitionLog != string.Empty) { tlstrpActionMenuBtnConfirm.Enabled = false; tlstrpLblExcecao.Text = _MenssageLogError; tlstrpLblExcecao.Visible = true; return; } this.Close(); }
/* -------------------------------------- INICIO BLOCO DE VALIDAÇÕES -------------------------------------- */ private void txtBxCodigo_KeyPress(object sender, KeyPressEventArgs e) { if (txtBxCodigo.Text == string.Empty) { ErrPrvdrNatureza.SetError(txtBxCodigo, ValidationsMessages.VALIDA_CAMPO_VAZIO); tlstrpActionMenuBtnConfirm.Enabled = false; } else { ErrPrvdrNatureza.SetError(txtBxCodigo, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; if (!ValidationData.CreateInstance.ValidaAceiteSomenteNumeros(txtBxCodigo.Text)) { ErrPrvdrNatureza.SetError(txtBxCodigo, ValidationsMessages.VALIDA_CODIGO); tlstrpActionMenuBtnConfirm.Enabled = false; } else { ErrPrvdrNatureza.SetError(txtBxCodigo, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; } } }
private void txtBxDescricao_KeyPress(object sender, KeyPressEventArgs e) { ErrPrvdrNatureza.SetError(txtBxDescricao, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; tlstrpLblError.Visible = false; }