private void tlstrpActionMenuBtnConfirm_Click(object sender, System.EventArgs e) { this.ExecuteModifyEstado(); if (txtBxSigla.Text == string.Empty) { ErrPrvdrEstado.SetError(txtBxSigla, ValidationsMessages.VALIDA_CAMPO_VAZIO); tlstrpActionMenuBtnConfirm.Enabled = false; tlstrpLblError.Visible = true; txtBxSigla.Focus(); return; } if (txtBxDescricao.Text == string.Empty) { ErrPrvdrEstado.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(); }
private void txtBxDescricao_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (txtBxDescricao.Text == string.Empty) { ErrPrvdrEstado.SetError(txtBxDescricao, ValidationsMessages.VALIDA_CAMPO_VAZIO); tlstrpActionMenuBtnConfirm.Enabled = false; } else { ErrPrvdrEstado.SetError(txtBxDescricao, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; } }
// ...::: INICIO VALIDAÇÕES :::... private void txtBxSigla_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (!ValidationData.CreateInstance.ValidaAceiteSomenteCaracteres(txtBxSigla.Text)) { ErrPrvdrEstado.SetError(txtBxSigla, ValidationsMessages.VALIDA_UF); tlstrpActionMenuBtnConfirm.Enabled = false; } else { ErrPrvdrEstado.SetError(txtBxSigla, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; } }
private void txtBxSigla_KeyPress(object sender, KeyPressEventArgs e) { ErrPrvdrEstado.SetError(txtBxSigla, string.Empty); tlstrpActionMenuBtnConfirm.Enabled = true; tlstrpLblError.Visible = false; }