Beispiel #1
0
 public virtual void ExcluirFormasPagVenda(FormasPagVenda FormasPagVenda)
 {
     try
     {
         _FormasPagVendaRepositorio.Deletar(c => c == FormasPagVenda);
         _FormasPagVendaRepositorio.Commit();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
 public virtual void AlterarFormasPagVenda(FormasPagVenda FormasPagVenda)
 {
     try
     {
         _FormasPagVendaRepositorio.Atualizar(FormasPagVenda);
         _FormasPagVendaRepositorio.Commit();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
        public void SyncFormaPagVendas(int pagina = -1)
        {
            try
            {
                venparListarRequest filtro = new venparListarRequest();

                if (Mensagem != null)
                {
                    Mensagem.Text = "Sincronizando cadastro de  Forma de Pagamento de Vendas";
                    Application.DoEvents();
                }

                filtro.registros_por_pagina = "50";

                if (pagina == -1)
                {
                    filtro.pagina = "1";
                }
                else
                {
                    filtro.pagina = pagina.ToString();
                }

                venparListarResponse resp = soapClient.ListarFormasPagVendas(filtro);

                if (ProgressBar != null)
                {
                    if (resp != null)
                    {
                        NrTotalRegistro = Convert.ToInt32(resp.total_de_registros);
                    }

                    ProgressBar.Maximum = NrTotalRegistro;
                }

                pagina = Convert.ToInt16(resp.pagina);

                foreach (cadastros item in resp.cadastros)
                {
                    if (formasPagVendaBLL.getFormasPagVenda(p => p.cDescricao == item.cDescricao).Count == 0)
                    {
                        FormasPagVenda formasPagVenda = new FormasPagVenda()
                        {
                            cCodigo    = item.cCodigo,
                            cDescricao = item.cDescricao,
                            nQtdeParc  = Convert.ToInt32(item.nQtdeParc)
                        };

                        formasPagVendaBLL.AdicionarFormasPagVenda(formasPagVenda);
                    }

                    RegistroAtual++;
                    if (ProgressBar != null)
                    {
                        ProgressBar.Value = RegistroAtual;
                        ProgressBar.Refresh();
                        Application.DoEvents();
                        if (QtdRegistros != null)
                        {
                            QtdRegistros.Text = RegistroAtual.ToString() + " de " + NrTotalRegistro.ToString();
                            Application.DoEvents();
                        }
                    }
                }

                if (pagina < Convert.ToInt16(resp.total_de_paginas))
                {
                    pagina++;
                    SyncFormaPagVendas(pagina);
                }
                //if (formasPagVendaBLL.getFormasPagVenda().Count() < Convert.ToInt32(resp.total_de_registros) )
                //{

                //}
            }
            catch (Exception)
            {
                throw;
            }
        }