コード例 #1
0
        public void EnviarLoteContabil()
        {
            LoteContabil lote = null;

            using (var loteContabilWS = new LoteContabilWS())
            {
                loteContabilWS.UrlWsLoteContabil = this.UrlWsLoteContabil;
                loteContabilWS.TimeoutWS         = this.TimeoutWS;

                lock (this.ObjectLock)
                    lote = this.LoteContabilRepository.BuscarLoteContabil();

                while (lote != null)
                {
                    var retornoWS = loteContabilWS.EnviarLoteContabil(this.ConverterLoteContabil(lote));

                    if (retornoWS != null)
                    {
                        lock (this.ObjectLock)
                            this.LoteContabilRepository.InserirNumeroLote(lote, retornoWS.erroExecucao, retornoWS.numLot);
                    }

                    lock (this.ObjectLock)
                        lote = this.LoteContabilRepository.BuscarLoteContabil();
                }
            }
        }
コード例 #2
0
 private void IndexarFormulario(LoteContabil loteAnt)
 {
     lookUpMatriz1.FindSetMatriz(loteAnt.Matriz);
     txtDescricao.Text  = loteAnt.DescricaoLote;
     dtInicial.DateTime = loteAnt.DataInicial;
     dtFinal.DateTime   = loteAnt.DataFinal.Value;
 }
コード例 #3
0
        //adição
        public XFrmAddLancamentoContabil(Usuario _currentUser, LoteContabil _lote = null) : this()
        {
            this._currentUser = _currentUser;
            this._lote        = _lote;
            this.partidas     = new List <PartidaContabil>();

            if (_lote != null)
            {
                lookUpMatriz1.FindSetMatriz(_lote.Matriz);
            }

            refreshGrid();
        }
コード例 #4
0
 private gerarlotectbGerar2In ConverterLoteContabil(LoteContabil lote)
 {
     return(new gerarlotectbGerar2In()
     {
         codEmp = lote.CODEMP,
         codFil = lote.CODFIL,
         oriLot = lote.ORILCT,
         desLot = lote.DESLOT,
         totLot = lote.TOTINFS,
         datLot = lote.DATLOT,
         tipLot = "MAN",
         codEmpSpecified = true,
         codFilSpecified = true,
         totLotSpecified = true
     });
 }
コード例 #5
0
 public bool Update(LoteContabil novo)
 {
     try
     {
         using (var ctx = new BalcaoContext())
         {
             var current = ctx.LoteContabilDao.Find(novo.IdLote);
             current.Update(novo);
             return(ctx.LoteContabilDao.Update(current));
         }
     }
     catch (Exception ex)
     {
         XMessageIts.ExceptionMessageDetails(ex, "Ocorreu um erro ao salvar o lote.", "Erro");
         return(false);
     }
 }
コード例 #6
0
 public void InserirNumeroLote(LoteContabil lote, string erroExecucao, int?numLot)
 {
     if (lote != null)
     {
         this.Connection.Execute(
             Queries.INSERIR_NUMERO_LOTE, new
         {
             erroExecucao  = erroExecucao,
             numLot        = numLot?.ToString(),
             chave         = lote.CHAVE.ToString(),
             empresa       = lote.CODEMP,
             filial        = lote.CODFIL,
             dataLote      = lote.DATLOT,
             numeroLoteCRK = lote.NNUMLOTCRK
         },
             commandType: CommandType.StoredProcedure);
     }
 }
コード例 #7
0
 public bool SaveLote(LoteContabil lote)
 {
     try
     {
         using (var ctx = new BalcaoContext())
         {
             lote.Matriz = null;
             lote.newGuidID();
             lote.NumeroLote = GetNewLoteNumber();
             return(ctx.LoteContabilDao.Save(lote));
         }
     }
     catch (Exception ex)
     {
         XMessageIts.ExceptionMessageDetails(ex, "Ocorreu um erro ao salvar o lote.", "Erro");
         return(false);
     }
 }
コード例 #8
0
        private LoteContabil IndexarLote()
        {
            var descricao = txtDescricao.Text;
            var dtInicio  = dtInicial.DateTime;
            var dtFim     = dtFinal.DateTime;
            var matriz    = lookUpMatriz1.Matriz;

            var l = new LoteContabil()
            {
                IdMatriz      = matriz.IdMatriz,
                Matriz        = matriz,
                DataInicial   = dtInicio,
                DataFinal     = dtFim,
                DescricaoLote = descricao,
                IdUsuario     = _currentUser.IdUsuario,
                DataCriacao   = DateTime.Now
            };

            return(l);
        }
コード例 #9
0
 public XFrmAddLoteContabil(LoteContabil loteAnt, Usuario user) : this()
 {
     this._loteAnterior = loteAnt;
     this._currentUser  = user;
     IndexarFormulario(loteAnt);
 }
コード例 #10
0
 public XFrmLancamentosContabeisView(Usuario currentUser, LoteContabil lote) : this()
 {
     this._currentUser = currentUser;
     this._lote        = lote;
     this.Text         = "Lançamentos contábeis: " + "- Lote: " + lote.NumeroLote + " - " + lote.DescricaoLote;
 }