// OPEN PROCURA FORM //------------------------------------------------------------------------------------------------------------ private void btnSetSetor_Click(object sender, EventArgs e) { try { // --- Ampulheta ON Cursor.Current = Cursors.WaitCursor; Setores.frmSetorProcura frm = new Setores.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; } }
private objCaixaAjuste CreateAjuste(decimal ajusteValue) { // get Setor de Entrada objSetor setor = null; Setores.frmSetorProcura frm = new Setores.frmSetorProcura(this); frm.ShowDialog(); //--- check return if (frm.DialogResult == DialogResult.OK) { setor = frm.propEscolha; if (contaSelected.IDCongregacao != setor.IDCongregacao) { var resp = AbrirDialog("A Congregação Padrão do Setor de Recursos escolhido é " + "diferente da congregação padrão da Conta do Caixa...\n" + "Deseja continuar assim mesmo?", "Congregação Divergente", DialogType.SIM_NAO, DialogIcon.Question, DialogDefaultButton.Second); if (resp == DialogResult.No) { return(null); } } } else { return(null); } objCaixaAjuste ajuste = new objCaixaAjuste(null) { AjusteDescricao = $"Ajuste de Nivelamento de Caixa: {_caixa.IDCaixa:D4}", IDAjusteTipo = 2, IDSetor = (int)setor.IDSetor, Setor = setor.Setor, IDUserAuth = (int)Program.usuarioAtual.IDUsuario, MovData = _caixa.DataFinal, MovValor = ajusteValue, MovValorReal = Math.Abs(ajusteValue), IDConta = _caixa.IDConta, Conta = _caixa.Conta, }; return(ajuste); }
private objCaixaAjuste CreateAjuste() { // get Setor de Entrada objSetor setor = null; Setores.frmSetorProcura frm = new Setores.frmSetorProcura(this); frm.ShowDialog(); //--- check return if (frm.DialogResult == DialogResult.OK) { setor = frm.propEscolha; if (propConta.IDCongregacao != setor.IDCongregacao) { var resp = AbrirDialog("A Congregação Padrão do Setor de Recursos escolhido é " + "diferente da congregação padrão da Nova Conta...\n" + "Deseja continuar assim mesmo?", "Congregação Divergente", DialogType.SIM_NAO, DialogIcon.Question, DialogDefaultButton.Second); if (resp == DialogResult.No) { return(null); } } } else { return(null); } objCaixaAjuste ajuste = new objCaixaAjuste(null) { AjusteDescricao = "Ajuste de Saldo Inicial Conta", IDConta = (int)propConta.IDConta, Conta = propConta.Conta, IDAjusteTipo = 1, IDSetor = (int)setor.IDSetor, Setor = setor.Setor, IDUserAuth = (int)Program.usuarioAtual.IDUsuario, MovData = dtpDataInicial.Value, MovValor = propConta.ContaSaldo, MovValorReal = propConta.ContaSaldo }; return(ajuste); }
private void btnSetSetor_Click(object sender, EventArgs e) { try { // --- Ampulheta ON Cursor.Current = Cursors.WaitCursor; Setores.frmSetorProcura frm = new Setores.frmSetorProcura(this, _cartao.IDSetorCartao); frm.ShowDialog(); //--- check return if (frm.DialogResult == DialogResult.OK) { if (Sit != EnumFlagEstado.NovoRegistro && _cartao.IDSetorCartao != frm.propEscolha.IDSetor) { Sit = EnumFlagEstado.Alterado; } _cartao.IDSetorCartao = (int)frm.propEscolha.IDSetor; txtSetor.Text = frm.propEscolha.Setor; } //--- 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; } }
private void mnuDefinirSetor_Click(object sender, EventArgs e) { //--- check selected item if (dgvListagem.SelectedRows.Count == 0) { AbrirDialog("Favor selecionar um registro para Definir o Setor...", "Selecionar Registro", DialogType.OK, DialogIcon.Information); return; } //--- get Selected item objContribuicao item = (objContribuicao)dgvListagem.SelectedRows[0].DataBoundItem; try { // --- Ampulheta ON Cursor.Current = Cursors.WaitCursor; Setores.frmSetorProcura frm = new Setores.frmSetorProcura(this, item.IDSetor); frm.ShowDialog(); //--- check return if (frm.DialogResult != DialogResult.OK) { return; } item.IDSetor = frm.propEscolha.IDSetor; item.Setor = frm.propEscolha.Setor; } catch (Exception ex) { AbrirDialog("Uma exceção ocorreu ao abrir o formulário de procura de setor..." + "\n" + ex.Message, "Exceção", DialogType.OK, DialogIcon.Exclamation); } finally { // --- Ampulheta OFF Cursor.Current = Cursors.Default; } DialogResult resp; resp = AbrirDialog("Deseja realmente DEFINIR o SETOR na contribuição selecionada?" + $"\nSetor Escolhido: {item.Setor.ToUpper()}" + "\nEssa ação será definitiva...", "Definir Setor", DialogType.SIM_NAO, DialogIcon.Question, DialogDefaultButton.Second); if (resp != DialogResult.Yes) { item.CancelEdit(); return; } try { // --- Ampulheta ON Cursor.Current = Cursors.WaitCursor; cBLL.UpdateContribuicaoSetor(item); ObterDados(); AbrirDialog("Setor Definido com sucesso!", "Setor Definido", DialogType.OK, DialogIcon.Information); } catch (Exception ex) { AbrirDialog("Uma exceção ocorreu ao Definir o Setor..." + "\n" + ex.Message, "Exceção", DialogType.OK, DialogIcon.Exclamation); } finally { // --- Ampulheta OFF Cursor.Current = Cursors.Default; } }