// OPEN PROCURA FORM //------------------------------------------------------------------------------------------------------------ private void btnSetSetor_Click(object sender, EventArgs e) { try { // --- Ampulheta ON Cursor.Current = Cursors.WaitCursor; frmSetorProcura frm = new frmSetorProcura(this, SetorSelected.IDSetor); frm.ShowDialog(); //--- check return if (frm.DialogResult == DialogResult.OK) { DefineSetor(frm.propEscolha); ObterDados(); } //--- select txtSetor.Focus(); txtSetor.SelectAll(); } catch (Exception ex) { AbrirDialog("Uma exceção ocorreu ao abrir o formulário de procura..." + "\n" + ex.Message, "Exceção", DialogType.OK, DialogIcon.Exclamation); } finally { // --- Ampulheta OFF Cursor.Current = Cursors.Default; } }
// CLICK LABEL TO DEFINE SETOR //------------------------------------------------------------------------------------------------------------ private void lblSetor_Click(object sender, EventArgs e) { DesativaPanel(ActiveMdiChild); // show var frm = new Setores.frmSetorProcura(null, propSetorPadrao?.IDSetor); frm.ShowDialog(); AtivaPanel(ActiveMdiChild); if (frm.DialogResult == DialogResult.OK) { // check Conta and Congregacao if (propContaPadrao.IDCongregacao != frm.propEscolha.IDCongregacao) { AbrirDialog("Esse setor não pertence à CONGREGAÇÃO padrão escolhida:\n" + propContaPadrao.Congregacao.ToUpper() + "\nFavor escolher um Setor que pertence à essa congregação.", "Definir Setor", DialogType.OK, DialogIcon.Exclamation); return; } propSetorPadrao = frm.propEscolha; } }