예제 #1
0
        public void AtualizarListaNFe()
        {
            try
            {
                using (ServidorClient serv = new ServidorClient())
                {
                    List <NfeCabecalhoDTO> listaNFeServ = serv.SelectNfeCabecalho(new NfeCabecalhoDTO());

                    ListaNFe.Clear();

                    foreach (NfeCabecalhoDTO nfe in listaNFeServ)
                    {
                        ListaNFe.Add(nfe);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        public void AtualizarListaNFe(int pagina)
        {
            try
            {
                using (ServidorClient Servico = new ServidorClient())
                {
                    if (pagina == 0)
                    {
                        IndiceNavegacao = 0;
                    }
                    else if (pagina > 0 && ListaNFe.Count == QuantidadePagina)
                    {
                        IndiceNavegacao += QuantidadePagina;
                    }
                    else if (pagina < 0 && IndiceNavegacao != 0)
                    {
                        IndiceNavegacao -= QuantidadePagina;
                    }

                    NfeCabecalhoDTO NFe = new NfeCabecalhoDTO();

                    IList <NfeCabecalhoDTO> ListaServ = Servico.SelectNfeCabecalhoPagina(IndiceNavegacao, QuantidadePagina, NFe);

                    ListaNFe.Clear();

                    foreach (NfeCabecalhoDTO objAdd in ListaServ)
                    {
                        ListaNFe.Add(objAdd);
                    }
                    NFeSelected = null;
                }
                QuantidadeCarregada = ListaNFe.Count;
                ControlarNavegacao();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }