示例#1
0
        public override string EjecutarAccion()
        {
            string str = "";
            RespuestaReferbdsjv respuestaReferbdsjv = HelperIbs.ibsReferenBcria(base.Afiliado.AF_CodCliente, base.Afiliado.sAF_Rif, this.NroCuenta);

            if (respuestaReferbdsjv.referbdsjv != null)
            {
                this.aficedula = base.Afiliado.sAF_Rif;
                this.literal   = respuestaReferbdsjv.referbdsjv.SLiteral;
                DateTime fecha = Formatos.ISOToFecha(respuestaReferbdsjv.referbdsjv.SFechaInicio);
                this.fechainicio = fecha.ToString("dd/MM/yyyy");
                this._base       = respuestaReferbdsjv.referbdsjv.SBase;
                long     nAFId      = base.Afiliado.nAF_Id;
                string   sCONombres = base.Afiliado.sCO_Nombres;
                string   str1       = DateTime.Now.ToString("dd/MM/yyyy");
                DateTime now        = DateTime.Now;
                string   str2       = string.Concat(HelperGlobal.LogRefBankAdd(nAFId, sCONombres, str1, now.ToShortTimeString(), WebUtils.GetClientIP(), "", "", this.NroCuenta, "", this.Dirigido, this.fechainicio, "", "", "", "", ""));
                this.referencia = string.Concat("IBRBC", str2.PadLeft(10, '0'));
                str             = this.referencia;
            }
            else
            {
                str = "Fallo referencia";
            }
            try
            {
                HelperEnvioCorreo.BuscarCamposCorreo(base.sCod, base.Afiliado.sCO_Nombres.ToUpper(), base.Afiliado.CO_Email, new decimal(0), "", Formatos.formatoCuenta(this.NroCuenta), this.referencia, base.Afiliado.sCO_Nombres.ToUpper(), "", "", this.NroCuenta, "", "", "", "", "", "", "");
            }
            catch (Exception exception)
            {
                string message = exception.Message;
            }
            return(str);
        }
示例#2
0
        public static RespuestaReferbdsjv ibsReferenBcria(long SUserId, string SCedRif, string SNroCta)
        {
            ReferbdsjvIn referbdsjvIn = new ReferbdsjvIn()
            {
                SUserId  = SUserId.ToString(),
                SCedRif  = SCedRif,
                SNroCta  = SNroCta,
                SPrefijo = string.Empty,
                SFiller  = string.Empty
            };
            RespuestaReferbdsjv respuestaReferbdsjv = null;

            using (IbsServiceService ibsServiceService = new IbsServiceService())
            {
                ibsServiceService.Timeout = 10000;
                try
                {
                    respuestaReferbdsjv = ibsServiceService.ibaReferenBcria(referbdsjvIn);
                    if (respuestaReferbdsjv == null)
                    {
                        throw new IBException(9998, "SQLIB");
                    }
                    if (!string.IsNullOrEmpty(respuestaReferbdsjv.SError))
                    {
                        throw new IBException(respuestaReferbdsjv.SError, "SQLIB");
                    }
                    if (respuestaReferbdsjv.referbdsjv == null)
                    {
                        throw new IBException(9998, "SQLIB");
                    }
                    if ((respuestaReferbdsjv.referbdsjv.EErrores == null ? false : !string.IsNullOrEmpty(respuestaReferbdsjv.referbdsjv.EErrores.SVectorCod)))
                    {
                        throw new IBException(respuestaReferbdsjv.referbdsjv.EErrores.SVectorCod, "IBS");
                    }
                }
                catch (WebException webException)
                {
                    throw new IBException(9997, "SQLIB");
                }
                catch (SoapException soapException)
                {
                    throw new IBException(9997, "SQLIB");
                }
            }
            return(respuestaReferbdsjv);
        }