예제 #1
0
        public static RespuestaIfcedoctadsjv ibsEstadoCta(long SUserId, string SCedRif, string SNroCta, string SFecha)
        {
            IfcedoctadsjvIn ifcedoctadsjvIn = new IfcedoctadsjvIn()
            {
                SUserId  = SUserId.ToString(),
                SCedRif  = SCedRif,
                SNroCta  = SNroCta,
                SFecha   = SFecha,
                SPrefijo = string.Empty,
                SFiller  = string.Empty
            };
            RespuestaIfcedoctadsjv respuestaIfcedoctadsjv = null;

            using (IbsServiceService ibsServiceService = new IbsServiceService())
            {
                ibsServiceService.Timeout = 60000;
                try
                {
                    respuestaIfcedoctadsjv = ibsServiceService.ibaEstadoCta(ifcedoctadsjvIn);
                    if (respuestaIfcedoctadsjv == null)
                    {
                        throw new IBException(9998, "SQLIB");
                    }
                    if (!string.IsNullOrEmpty(respuestaIfcedoctadsjv.SError))
                    {
                        throw new IBException(respuestaIfcedoctadsjv.SError, "SQLIB");
                    }
                    if (respuestaIfcedoctadsjv.ifcedoctadsjv == null)
                    {
                        throw new IBException(9998, "SQLIB");
                    }
                    if ((respuestaIfcedoctadsjv.ifcedoctadsjv.EErrores == null ? false : !string.IsNullOrEmpty(respuestaIfcedoctadsjv.ifcedoctadsjv.EErrores.SVectorCod)))
                    {
                        throw new IBException(respuestaIfcedoctadsjv.ifcedoctadsjv.EErrores.SVectorCod, "IBS");
                    }
                }
                catch (WebException webException)
                {
                    throw new IBException(9997, "SQLIB");
                }
                catch (SoapException soapException)
                {
                    throw new IBException(9997, "SQLIB");
                }
            }
            return(respuestaIfcedoctadsjv);
        }
예제 #2
0
        private void binddata()
        {
            string sNroCuenta = this.ddlCuenta.getCuenta().SNroCuenta;

            try
            {
                RespuestaIfcedoctadsjv respuestaIfcedoctadsjv = HelperIbs.ibsEstadoCta(base.Afiliado.AF_CodCliente, base.Afiliado.sAF_Rif, sNroCuenta, this.ddlMes.SelectedValue);
                if (respuestaIfcedoctadsjv.ifcedoctadsjv.ifcedoctadsjvDet.Length == 0)
                {
                    WebUtils.MessageBox2005(this, "No existen movimientos para este mes");
                    return;
                }
                else
                {
                    if (this.dataEnc == null)
                    {
                        this.dataEnc = new DataTable();
                        this.dataEnc.Columns.Add("SCuenta", typeof(string));
                        this.dataEnc.Columns.Add("SNombre", typeof(string));
                        this.dataEnc.Columns.Add("SDireccion1", typeof(string));
                        this.dataEnc.Columns.Add("SDireccion2", typeof(string));
                        this.dataEnc.Columns.Add("SDireccion3", typeof(string));
                        this.dataEnc.Columns.Add("SDireccion4", typeof(string));
                        this.dataEnc.Columns.Add("SNombreProdcto", typeof(string));
                        this.dataEnc.Columns.Add("SSaldoIniMes", typeof(string));
                        this.dataEnc.Columns.Add("SDepoEfec", typeof(string));
                        this.dataEnc.Columns.Add("SInteres", typeof(string));
                        this.dataEnc.Columns.Add("SInteresCant", typeof(string));
                        this.dataEnc.Columns.Add("SOtrosCredCta", typeof(string));
                        this.dataEnc.Columns.Add("SOtrosCredCtaCant", typeof(string));
                        this.dataEnc.Columns.Add("SCheqpagados", typeof(string));
                        this.dataEnc.Columns.Add("SCheqpagadosCant", typeof(string));
                        this.dataEnc.Columns.Add("SITF", typeof(string));
                        this.dataEnc.Columns.Add("SITFCant", typeof(string));
                        this.dataEnc.Columns.Add("SOtrosDebCta", typeof(string));
                        this.dataEnc.Columns.Add("SCantOtrosDebCta", typeof(string));
                        this.dataEnc.Columns.Add("SSaldoFinMes", typeof(string));
                        this.dataEnc.Columns.Add("SSaldoGirable", typeof(string));
                        this.dataEnc.Columns.Add("SLimitSgiro", typeof(string));
                        this.dataEnc.Columns.Add("SFechaDesde", typeof(string));
                        this.dataEnc.Columns.Add("SFechaHasta", typeof(string));
                        this.dataEnc.Columns.Add("STotalDebitos", typeof(string));
                        this.dataEnc.Columns.Add("STotalCreditos", typeof(string));
                        this.dataEnc.Columns.Add("SSaldoFinal", typeof(string));
                        this.dataEnc.Columns.Add("pagina", typeof(int));
                        this.dataEnc.Columns.Add("totalpaginas", typeof(int));
                    }
                    this.dataEnc.Rows.Clear();
                    if (this.dataDet == null)
                    {
                        this.dataDet = new DataTable();
                        this.dataDet.Columns.Add("FechaOperacion", typeof(string));
                        this.dataDet.Columns.Add("FechaEfectiva", typeof(string));
                        this.dataDet.Columns.Add("NumeroDocumento", typeof(string));
                        this.dataDet.Columns.Add("Descripcion", typeof(string));
                        this.dataDet.Columns.Add("Cargos", typeof(string));
                        this.dataDet.Columns.Add("Abonos", typeof(string));
                        this.dataDet.Columns.Add("Saldo", typeof(string));
                    }
                    this.dataDet.Rows.Clear();
                    DataRow str = this.dataDet.NewRow();
                    str["Descripcion"] = "SALDO INICIAL :...";
                    str["Saldo"]       = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SSaldoIniMes));
                    this.dataDet.Rows.Add(str);
                    IfcedoctadsjvDet[] ifcedoctadsjvDetArray = respuestaIfcedoctadsjv.ifcedoctadsjv.ifcedoctadsjvDet;
                    for (int i = 0; i < (int)ifcedoctadsjvDetArray.Length; i++)
                    {
                        IfcedoctadsjvDet ifcedoctadsjvDet = ifcedoctadsjvDetArray[i];
                        str = this.dataDet.NewRow();
                        DateTime fecha = Formatos.ISOToFecha(ifcedoctadsjvDet.SFechaProc);
                        str["FechaOperacion"] = fecha.ToString("dd/MM/yyyy");
                        DateTime dateTime = Formatos.ISOToFecha(ifcedoctadsjvDet.SFechaValor);
                        str["FechaEfectiva"]   = dateTime.ToString("dd/MM/yyyy");
                        str["NumeroDocumento"] = ifcedoctadsjvDet.SChqRef;
                        str["Descripcion"]     = string.Concat(ifcedoctadsjvDet.SDesctrans, ifcedoctadsjvDet.SDescripcion1);
                        if (ifcedoctadsjvDet.SIndDebCre.Equals("0"))
                        {
                            str["Cargos"] = Formatos.formatoMonto(ifcedoctadsjvDet.SMonto);
                        }
                        if (ifcedoctadsjvDet.SIndDebCre.Equals("5"))
                        {
                            str["Abonos"] = Formatos.formatoMonto(ifcedoctadsjvDet.SMonto);
                        }
                        str["Saldo"] = Formatos.formatoMonto(ifcedoctadsjvDet.SBalanceFin);
                        this.dataDet.Rows.Add(str);
                    }
                    this.totalpaginas = 1;
                    if (this.dataDet.Rows.Count > 45)
                    {
                        double num  = Convert.ToDouble(this.dataDet.Rows.Count - 45) / Convert.ToDouble(60);
                        string str1 = num.ToString().Replace(",", ".");
                        int    num1 = Convert.ToInt32(str1.Substring(0, str1.IndexOf(".")));
                        if ((float)num - (float)num1 > 0f)
                        {
                            EstadoCuentaBusqueda estadoCuentaBusqueda = this;
                            estadoCuentaBusqueda.totalpaginas = estadoCuentaBusqueda.totalpaginas + num1 + 1;
                        }
                    }
                    this.sb = new StringBuilder();
                    this.sb.Append("var next = 1;\n");
                    this.sb.Append("function plus(){ next++; mostrar(next); }\n");
                    this.sb.Append("function minus(){ next--; mostrar(next); }\n");
                    this.sb.Append(string.Concat("var paneles = new Array(", this.totalpaginas, ");\n"));
                    this.sb.Append("function mostrar(x)\n");
                    this.sb.Append("{\n");
                    this.sb.Append("var i; \n");
                    this.sb.Append("for(i = 0;i < paneles.length; i++)\n");
                    this.sb.Append("{\n");
                    this.sb.Append("$(paneles[i]).style.display='none';\n");
                    this.sb.Append("}\n");
                    this.sb.Append("$(paneles[x-1]).style.display='block';\n");
                    this.sb.Append("next = x;\n");
                    this.sb.Append("$('btnNext').disabled = ( next == paneles.length );\n");
                    this.sb.Append("$('btnPrevious').disabled = ( next == 1 );\n");
                    this.sb.Append("$('divPaginas').innerHTML ='Página ' + next + ' de ' + paneles.length;\n");
                    this.sb.Append("};");
                    this.dataEnc.Rows.Clear();
                    for (int j = 0; j < this.totalpaginas; j++)
                    {
                        DataRow sNombre = this.dataEnc.NewRow();
                        sNombre["SCuenta"]        = Formatos.formatoCuenta(sNroCuenta);
                        sNombre["SNombre"]        = respuestaIfcedoctadsjv.ifcedoctadsjv.SNombre;
                        sNombre["SDireccion1"]    = respuestaIfcedoctadsjv.ifcedoctadsjv.SDireccion1;
                        sNombre["SDireccion2"]    = respuestaIfcedoctadsjv.ifcedoctadsjv.SDireccion2;
                        sNombre["SDireccion3"]    = respuestaIfcedoctadsjv.ifcedoctadsjv.SDireccion3;
                        sNombre["SDireccion4"]    = respuestaIfcedoctadsjv.ifcedoctadsjv.SDireccion4;
                        sNombre["SNombreProdcto"] = respuestaIfcedoctadsjv.ifcedoctadsjv.SNombreProdcto;
                        DateTime fecha1 = Formatos.ISOToFecha(respuestaIfcedoctadsjv.ifcedoctadsjv.SFechaDesde);
                        sNombre["SFechaDesde"]       = fecha1.ToString("dd/MM/yyyy");
                        sNombre["SSaldoIniMes"]      = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SSaldoIniMes));
                        sNombre["SDepoEfec"]         = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SDepoEfec));
                        sNombre["SInteres"]          = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SInteres));
                        sNombre["SInteresCant"]      = respuestaIfcedoctadsjv.ifcedoctadsjv.SCantIntereses;
                        sNombre["SOtrosCredCta"]     = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SOtrosCredCta));
                        sNombre["SOtrosCredCtaCant"] = respuestaIfcedoctadsjv.ifcedoctadsjv.SCantOtrosCredCta;
                        sNombre["SCheqpagados"]      = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SCheqpagados));
                        sNombre["SCheqpagadosCant"]  = respuestaIfcedoctadsjv.ifcedoctadsjv.SCantCheqpagados;
                        sNombre["SITF"]             = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SITF));
                        sNombre["SITFCant"]         = respuestaIfcedoctadsjv.ifcedoctadsjv.SCantITF;
                        sNombre["SOtrosDebCta"]     = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SOtrosDebCta));
                        sNombre["SCantOtrosDebCta"] = respuestaIfcedoctadsjv.ifcedoctadsjv.SCantOtrosDebCta;
                        DateTime dateTime1 = Formatos.ISOToFecha(respuestaIfcedoctadsjv.ifcedoctadsjv.SFechaHasta);
                        sNombre["SFechaHasta"]   = dateTime1.ToString("dd/MM/yyyy");
                        sNombre["SSaldoFinMes"]  = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SSaldoFinMes));
                        sNombre["SSaldoGirable"] = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SSaldoGirable));
                        sNombre["SLimitSgiro"]   = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaIfcedoctadsjv.ifcedoctadsjv.SLimitSgiro));
                        sNombre["totalpaginas"]  = this.totalpaginas;
                        this.dataEnc.Rows.Add(sNombre);
                    }
                    this.rptCabecera.DataSource = this.dataEnc;
                    this.rptCabecera.DataBind();
                    this.panelBotones.Visible = true;
                }
            }
            catch (IBException bException)
            {
                WebUtils.MessageBox2005(this, bException.IBMessage);
                return;
            }
            Literal literal = this.liBotones;

            object[] objArray = new object[] { "<table><tr><td><div id='divPaginas'>Página 1 de ", this.totalpaginas, "</div></td><td><input id='btnPrevious' type='button' value='<' onclick='minus();' disabled=true style='width:20px' /><input id='btnNext' type='button' value='>' onclick='plus();' style='width:20px' ", null, null };
            objArray[3]  = (this.totalpaginas == 1 ? "disabled=true" : "");
            objArray[4]  = "/></td></tr></table>";
            literal.Text = string.Concat(objArray);
            System.Web.UI.Page page = this.Page;
            Type type = this.Page.GetType();
            Guid guid = Guid.NewGuid();

            System.Web.UI.ScriptManager.RegisterClientScriptBlock(page, type, guid.ToString(), string.Concat("<script type='text/javascript' language='javascript'>", this.sb.ToString(), "</script>"), false);
        }