Beispiel #1
0
        public override int buscarRegistros()
        {
            TList_CadCFOP lista = TCN_CadCFOP.Busca(cd_cfop.Text,
                                                    ds_cfop.Text,
                                                    string.Empty,
                                                    st_bonificacao.Checked,
                                                    cbUsoConsumo.Checked,
                                                    st_devolucao.Checked,
                                                    st_remessa.Checked,
                                                    st_retorno.Checked,
                                                    null);

            if (lista != null)
            {
                if (lista.Count > 0)
                {
                    this.Lista         = lista;
                    BS_CFOP.DataSource = lista;
                }
                else
                if ((vTP_Modo == TTpModo.tm_Standby) || (vTP_Modo == TTpModo.tm_busca))
                {
                    BS_CFOP.Clear();
                }
                return(lista.Count);
            }
            else
            {
                return(0);
            }
        }
Beispiel #2
0
 public override void afterCancela()
 {
     base.afterCancela();
     if (this.vTP_Modo == TTpModo.tm_Insert)
     {
         BS_CFOP.RemoveCurrent();
     }
 }
Beispiel #3
0
 private void FCFOP_Load(object sender, EventArgs e)
 {
     this.Icon = Utils.ResourcesUtils.TecnoAliance_ICO;
     if (cCFOP != null)
     {
         BS_CFOP.Add(cCFOP);
     }
     else
     {
         BS_CFOP.AddNew();
     }
 }
Beispiel #4
0
 public override void afterNovo()
 {
     if ((this.vTP_Modo == TTpModo.tm_busca) || (this.vTP_Modo == TTpModo.tm_Standby))
     {
         BS_CFOP.AddNew();
         base.afterNovo();
         if (!(cd_cfop.Focus()))
         {
             ds_cfop.Focus();
         }
     }
 }
Beispiel #5
0
 public override void afterExclui()
 {
     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)
         {
             TCN_CadCFOP.Excluir((BS_CFOP.Current as TRegistro_CadCFOP), null);
             BS_CFOP.RemoveCurrent();
             pDados.LimparRegistro();
             afterBusca();
         }
     }
 }
Beispiel #6
0
        private void gCadastro_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (gCadastro.Columns[e.ColumnIndex].SortMode == DataGridViewColumnSortMode.NotSortable)
            {
                return;
            }
            if (BS_CFOP.Count < 1)
            {
                return;
            }
            PropertyDescriptorCollection lP = TypeDescriptor.GetProperties(new TRegistro_CadCFOP());
            TList_CadCFOP 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_CadCFOP(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_CadCFOP(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_CFOP.List as TList_CadCFOP).Sort(lComparer);
            BS_CFOP.ResetBindings(false);
            gCadastro.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = direcao;
        }