コード例 #1
0
        public void DesbloqueioOp(string key, string password, IProgramacaoDesembolso programacaoDesembolso)
        {
            var result = DataHelperProdespPagamentoContaUnica.Procedure_DesbloqueioPagtoDoc(key, password, programacaoDesembolso) ?? new Procedure_DesbloqueioPagtoDocRecordType[] { };

            if (!string.IsNullOrEmpty(result[0]?.outErro))
            {
                throw new SidsException($"Prodesp - {result[0]?.outErro}");
            }
        }
コード例 #2
0
        public void TransmitirDesbloqueioOp(IProgramacaoDesembolso entity, int recursoId)
        {
            var cicsmo = new ChaveCicsmo();
            IProgramacaoDesembolso objModel;
            IEnumerable <ProgramacaoDesembolsoAgrupamento> pds;

            if (entity.ProgramacaoDesembolsoTipoId == 1 || entity.ProgramacaoDesembolsoTipoId == 3)
            {
                objModel = Selecionar(entity.Id);
            }
            else
            {
                objModel = _agrupamento.Buscar(new ProgramacaoDesembolsoAgrupamento {
                    Id = entity.Id
                }).FirstOrDefault();
            }

            try
            {
                cicsmo = _chave.ObterChave(recursoId);

                objModel.TipoBloqueio = entity.TipoBloqueio;

                _prodesp.DesbloqueioOp(cicsmo.Chave, cicsmo.Senha, objModel);

                objModel.Bloqueio = false;
            }
            catch (Exception ex)
            {
                throw SaveLog(ex, (short?)EnumAcao.Transmitir, recursoId);
            }
            finally
            {
                _chave.LiberarChave(cicsmo.Codigo);

                if (entity.ProgramacaoDesembolsoTipoId == 1 || entity.ProgramacaoDesembolsoTipoId == 3)
                {
                    SalvarOuAlterar((ProgramacaoDesembolso)objModel, 0, (short)EnumAcao.Transmitir);
                }
                else
                {
                    pds = _agrupamento.Buscar(new ProgramacaoDesembolsoAgrupamento {
                        NumeroDocumento = objModel.NumeroDocumento, NumeroAgrupamento = objModel.NumeroAgrupamento
                    });

                    foreach (var programacao in pds)
                    {
                        programacao.TipoBloqueio = objModel.TipoBloqueio;
                        programacao.Bloqueio     = false;

                        _agrupamento.SalvarOuAlterar(programacao, 0, (short)EnumAcao.Transmitir);
                    }
                }
            }
        }
コード例 #3
0
        public void TransmitirCancelamentoOp(IProgramacaoDesembolso entity, int recursoId)
        {
            var cicsmo = new ChaveCicsmo();
            IProgramacaoDesembolso objModel;

            if (entity.ProgramacaoDesembolsoTipoId == 1 || entity.ProgramacaoDesembolsoTipoId == 3)
            {
                objModel = Selecionar(entity.Id);
            }
            else
            {
                objModel = _agrupamento.Buscar(new ProgramacaoDesembolsoAgrupamento {
                    Id = entity.Id
                }).FirstOrDefault();
            }

            try
            {
                cicsmo = _chave.ObterChave(recursoId);
                objModel.TipoBloqueio = entity.TipoBloqueio;

                _prodesp.CancelamentoOp(cicsmo.Chave, cicsmo.Senha, objModel);

                if (entity.Bloqueio)
                {
                    TransmitirBoqueioOp(objModel, recursoId);
                    objModel.Bloqueio = true;
                }

                objModel.Cancelado = true;
            }
            catch (Exception ex)
            {
                throw SaveLog(ex, (short?)EnumAcao.Transmitir, recursoId);
            }
            finally
            {
                _chave.LiberarChave(cicsmo.Codigo);

                if (entity.ProgramacaoDesembolsoTipoId == 1 || entity.ProgramacaoDesembolsoTipoId == 3)
                {
                    SalvarOuAlterar((ProgramacaoDesembolso)objModel, 0, (short)EnumAcao.Transmitir);
                }
                else
                {
                    _agrupamento.SalvarOuAlterar((ProgramacaoDesembolsoAgrupamento)objModel, 0, (short)EnumAcao.Transmitir);
                }
            }
        }
コード例 #4
0
        private Error Retransmissao(Usuario user, IProgramacaoDesembolso entity, int recursoId)
        {
            var error  = new Error();
            var cicsmo = new ChaveCicsmo();

            try
            {
                try
                {
                    var ug = _regional.Buscar(new Regional {
                        Id = (int)user.RegionalId
                    }).First().Uge;

                    if (entity.TransmitirSiafem && !entity.TransmitidoSiafem)
                    {
                        if (entity.ProgramacaoDesembolsoTipoId == 1 || entity.ProgramacaoDesembolsoTipoId == 3)
                        {
                            TransmitirNomal((ProgramacaoDesembolso)entity, user, ug);
                        }
                        else
                        {
                            TransmitirSiafemRobo(user, ug, (ProgramacaoDesembolsoAgrupamento)entity, false);
                        }
                    }
                }
                catch (Exception ex)
                { error.SiafemSiafisico = ex.Message; }
            }
            catch (Exception ex)
            {
                throw SaveLog(ex, (short?)EnumAcao.Transmitir, recursoId);
            }
            finally
            {
                _chave.LiberarChave(cicsmo.Codigo);
            }
            return(error);
        }
コード例 #5
0
 private static Procedure_CancelamentoOPFiltersType CancelamentoOPFiltersType(string key, string password, IProgramacaoDesembolso programacaoDesembolso)
 {
     return(new Procedure_CancelamentoOPFiltersType
     {
         inChave = password,
         inOperador = key,
         inTipo = programacaoDesembolso.DocumentoTipoId == 0 ? null : programacaoDesembolso.DocumentoTipoId.ToString("D2"),
         inNumero = programacaoDesembolso.NumeroDocumento?.Replace("/", "")
     });
 }
コード例 #6
0
 private static Procedure_BloqueioPagtoDocFiltersType BloqueioPagtoDocFiltersType(string key, string password, IProgramacaoDesembolso programacaoDesembolso)
 {
     return(new Procedure_BloqueioPagtoDocFiltersType
     {
         inChave = password,
         inOperador = key,
         inTipoDoc = programacaoDesembolso.DocumentoTipoId == 0 ? null : programacaoDesembolso.DocumentoTipoId.ToString("D2"),
         inNumeroDoc = programacaoDesembolso.NumeroDocumento?.Replace("/", "").Replace(" ", ""),
         inTipoBloqueio = programacaoDesembolso.TipoBloqueio.ToString()
     });
 }
コード例 #7
0
        public static Procedure_BloqueioPagtoDocApoioRecordType[] Procedure_BloqueioPagtoDocApoio(string key, string password, IProgramacaoDesembolso programacaoDesembolso)
        {
            var bloqueioPagtoDocApoioFiltersType = BloqueioPagtoDocApoioFiltersType(key, password, programacaoDesembolso);

            return(new WSProdespPagamentoContaUnica().Procedure_BloqueioPagtoDocApoio(bloqueioPagtoDocApoioFiltersType, new ModelVariablesType(), new EnvironmentVariablesType()));
        }
コード例 #8
0
        public static Procedure_CancelamentoOPRecordType[] Procedure_CancelamentoOP(string key, string password, IProgramacaoDesembolso programacaoDesembolso)
        {
            var cancelamentoOpFiltersType = CancelamentoOPFiltersType(key, password, programacaoDesembolso);

            return(new WSProdespPagamentoContaUnica().Procedure_CancelamentoOP(cancelamentoOpFiltersType, new ModelVariablesType(), new EnvironmentVariablesType()));
        }
コード例 #9
0
 public void DesbloqueioOp(string key, string password, IProgramacaoDesembolso programacaoDesembolso)
 {
     _contaUnica.DesbloqueioOp(key, password, programacaoDesembolso);
 }
コード例 #10
0
 public void CancelamentoOp(string key, string password, IProgramacaoDesembolso programacaoDesembolso)
 {
     _contaUnica.CancelamentoOp(key, password, programacaoDesembolso);
 }