Ejemplo n.º 1
0
        public override int buscarRegistros()
        {
            TList_CadCondPgto lista = TCN_CadCondPgto.Buscar(CD_CondPGTO.Text,
                                                             DS_CondPgto.Text,
                                                             CD_Portador.Text,
                                                             CD_Moeda.Text,
                                                             string.Empty,
                                                             CD_Juro.Text,
                                                             decimal.Zero,
                                                             decimal.Zero,
                                                             string.Empty,
                                                             string.Empty,
                                                             0,
                                                             string.Empty,
                                                             null);

            if (lista != null)
            {
                if (lista.Count > 0)
                {
                    BS_Cad_CondPGTO.DataSource = lista;
                    BS_Cad_CondPGTO_PositionChanged(this, new EventArgs());
                }
                else
                if ((vTP_Modo == TTpModo.tm_Standby) || (vTP_Modo == TTpModo.tm_busca))
                {
                    BS_Cad_CondPGTO.Clear();
                }
                return(lista.Count);
            }
            else
            {
                return(0);
            }
        }
Ejemplo n.º 2
0
 public override void excluirRegistro()
 {
     if (tcCentral.SelectedIndex == 0)
     {
         if (gCadastro.RowCount > 0)
         {
             if ((this.vTP_Modo == TTpModo.tm_Standby) || (this.vTP_Modo == TTpModo.tm_busca))
             {
                 if (MessageBox.Show("Confirma Exclusão do Registro?", "Mensagem",
                                     MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) ==
                     System.Windows.Forms.DialogResult.Yes)
                 {
                     try
                     {
                         TCN_CadCondPgto.DeletarCondPgto(BS_Cad_CondPGTO.Current as TRegistro_CadCondPgto, null);
                         BS_Cad_CondPGTO.RemoveCurrent();
                         pDados.LimparRegistro();
                         afterBusca();
                     }
                     catch (Exception ex)
                     {
                         MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("Opção desabilitada!");
     }
 }
Ejemplo n.º 3
0
 private void BS_Cad_CondPGTO_PositionChanged(object sender, EventArgs e)
 {
     if (BS_Cad_CondPGTO.Current != null)
     {
         if (!string.IsNullOrEmpty((BS_Cad_CondPGTO.Current as TRegistro_CadCondPgto).Cd_condpgto))
         {
             (BS_Cad_CondPGTO.Current as TRegistro_CadCondPgto).lCondPgto_X_Parcelas =
                 TCN_CadCondPgto_X_Parcelas.Buscar((BS_Cad_CondPGTO.Current as TRegistro_CadCondPgto).Cd_condpgto, null);
             BS_Cad_CondPGTO.ResetCurrentItem();
         }
     }
 }
Ejemplo n.º 4
0
 public override void afterNovo()
 {
     if ((this.vTP_Modo == Utils.TTpModo.tm_busca) || (this.vTP_Modo == Utils.TTpModo.tm_Standby))
     {
         BS_Cad_CondPGTO.AddNew();
         base.afterNovo();
         ST_VenctoEmFeriado.Enabled = false;
         if (!(this.CD_CondPGTO.Focus()))
         {
             this.DS_CondPgto.Focus();
         }
     }
 }
Ejemplo n.º 5
0
 public void InserirParcelas()
 {
     if (vTP_Modo.Equals(TTpModo.tm_Insert) || vTP_Modo.Equals(TTpModo.tm_Edit))
     {
         if (BS_Cad_CondPGTO.Current != null)
         {
             if ((BS_Cad_CondPGTO.Current as TRegistro_CadCondPgto).Qt_parcelas > 1)
             {
                 using (TFCadCondPGTO_X_Parcelas fCondParcelas = new TFCadCondPGTO_X_Parcelas())
                 {
                     fCondParcelas.rCondpgto = BS_Cad_CondPGTO.Current as CamadaDados.Financeiro.Cadastros.TRegistro_CadCondPgto;
                     fCondParcelas.ShowDialog();
                     BS_Cad_CondPGTO.ResetCurrentItem();
                 }
             }
             else
             {
                 MessageBox.Show("Permitido gerar parcelas somente de condição de pagamento com mais de uma parcela.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
 }
Ejemplo n.º 6
0
        private void gCadastro_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (gCadastro.Columns[e.ColumnIndex].SortMode == DataGridViewColumnSortMode.NotSortable)
            {
                return;
            }
            if (BS_Cad_CondPGTO.Count < 1)
            {
                return;
            }
            PropertyDescriptorCollection lP = TypeDescriptor.GetProperties(new TRegistro_CadCondPgto());
            TList_CadCondPgto            lComparer;
            SortOrder direcao = SortOrder.None;

            if ((gCadastro.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection == SortOrder.None) ||
                (gCadastro.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection == SortOrder.Descending))
            {
                lComparer = new TList_CadCondPgto(lP.Find(gCadastro.Columns[e.ColumnIndex].DataPropertyName, true), SortOrder.Ascending);
                foreach (DataGridViewColumn c in gCadastro.Columns)
                {
                    c.HeaderCell.SortGlyphDirection = SortOrder.None;
                }
                direcao = SortOrder.Ascending;
            }
            else
            {
                lComparer = new TList_CadCondPgto(lP.Find(gCadastro.Columns[e.ColumnIndex].DataPropertyName, true), SortOrder.Descending);
                foreach (DataGridViewColumn c in gCadastro.Columns)
                {
                    c.HeaderCell.SortGlyphDirection = SortOrder.None;
                }
                direcao = SortOrder.Descending;
            }
            (BS_Cad_CondPGTO.List as TList_CadCondPgto).Sort(lComparer);
            BS_Cad_CondPGTO.ResetBindings(false);
            gCadastro.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = direcao;
        }