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); }
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); }
private void llenarGrid() { if (this.rdoDia.Checked) { this.tipoConsulta = ConsultaMovimientoTipoConsulta.Dia; this.liCritero.Text = "Del Día"; } if (this.rdoDiaAnt.Checked) { this.tipoConsulta = ConsultaMovimientoTipoConsulta.DiaAnterior; this.liCritero.Text = "Del Día Anterior"; } if (this.rdoMes.Checked) { this.tipoConsulta = ConsultaMovimientoTipoConsulta.Mes; this.liCritero.Text = "Del Mes"; } if (this.rdoMesAnt.Checked) { this.tipoConsulta = ConsultaMovimientoTipoConsulta.MesAnterior; this.liCritero.Text = "Del Mes Anterior"; } if (this.rdoUltimosMov.Checked) { this.tipoConsulta = ConsultaMovimientoTipoConsulta.UltMovimientos; this.liCritero.Text = "Últimos movimientos"; } if (this.rdoRango.Checked) { this.tipoConsulta = ConsultaMovimientoTipoConsulta.RangoFecha; this.liCritero.Text = string.Concat("Rango de fechas del ", this.FD.Text, " al ", this.FH.Text); this.fechad = DateTime.Parse(this.FD.Text); this.fechah = DateTime.Parse(this.FH.Text); if (this.fechad > this.fechah) { throw new Exception("La Fecha Desde no puede ser mayor a la Fecha Hasta"); } if (DateAndTime.DateDiff(DateInterval.Day, this.fechad, this.fechah) > (long)60) { throw new Exception("El rango de fechas a consultar no puede ser mayor a dos(2) meses"); } } this.respuesta = HelperIbs.ibsConsultaMovimientos(base.Afiliado.AF_CodCliente, base.Afiliado.sAF_Rif, this.ddlCuenta.getCuenta().SNroCuenta, this.tipoConsulta, this.fechad, this.fechah, 20); List <MovimientosR> movimientosRs = new List <MovimientosR>(); StmrdsjvDet[] stmrdsjvDetArray = this.respuesta.stmjvCuentas.smtDetalle; for (int i = 0; i < (int)stmrdsjvDetArray.Length; i++) { StmrdsjvDet stmrdsjvDet = stmrdsjvDetArray[i]; if (stmrdsjvDet != null) { MovimientosR movimientosR = new MovimientosR() { SChqRef = stmrdsjvDet.SChqRef, SDesctrans = stmrdsjvDet.SDesctrans, SFechaEfect = Formatos.ISOToFecha(stmrdsjvDet.SFechaEfect), SFechaProc = Formatos.ISOToFecha(stmrdsjvDet.SFechaProc), SIndDebCre = stmrdsjvDet.SIndDebCre }; decimal num = Formatos.ISOToDecimal(stmrdsjvDet.SMonto); if (stmrdsjvDet.SIndDebCre.Trim().Contains("0")) { num *= new decimal(-1); } movimientosR.SMonto = num; movimientosRs.Add(movimientosR); } } JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("<script>"); stringBuilder.AppendFormat("myData = {0};loadTable();$('.iconconsultar').hide();", javaScriptSerializer.Serialize(movimientosRs)); this.loaded = true; stringBuilder.Append("</script>"); System.Web.UI.ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "MyData", stringBuilder.ToString(), false); }
protected void btnExportar_Click(object sender, EventArgs e) { DataTable dataTable = new DataTable(); dataTable.Columns.Add("SChqRef", typeof(string)); dataTable.Columns.Add("SDesctrans", typeof(string)); dataTable.Columns.Add("SFechaEfect", typeof(string)); dataTable.Columns.Add("SFechaProc", typeof(string)); dataTable.Columns.Add("SIndDebCre", typeof(string)); dataTable.Columns.Add("SMonto", typeof(string)); RespuestaStmrdsjv respuestaStmrdsjv = this.respuesta; if (respuestaStmrdsjv != null) { StmrdsjvDet[] stmrdsjvDetArray = respuestaStmrdsjv.stmjvCuentas.smtDetalle; for (int i = 0; i < (int)stmrdsjvDetArray.Length; i++) { StmrdsjvDet stmrdsjvDet = stmrdsjvDetArray[i]; if (stmrdsjvDet != null) { DataRow sChqRef = dataTable.NewRow(); sChqRef["SChqRef"] = stmrdsjvDet.SChqRef; sChqRef["SDesctrans"] = stmrdsjvDet.SDesctrans; DateTime fecha = Formatos.ISOToFecha(stmrdsjvDet.SFechaEfect); sChqRef["SFechaEfect"] = fecha.ToString("dd/MM/yyyy"); DateTime dateTime = Formatos.ISOToFecha(stmrdsjvDet.SFechaProc); sChqRef["SFechaProc"] = dateTime.ToString("dd/MM/yyyy"); sChqRef["SIndDebCre"] = stmrdsjvDet.SIndDebCre; decimal num = Formatos.ISOToDecimal(stmrdsjvDet.SMonto); if (stmrdsjvDet.SIndDebCre.Trim().Contains("0")) { num *= new decimal(-1); } sChqRef["SMonto"] = num; dataTable.Rows.Add(sChqRef); } } List <ExportUtils.ExportUtilDatos> exportUtilDatos = new List <ExportUtils.ExportUtilDatos>() { new ExportUtils.ExportUtilDatos("Fecha Transacción", "SFechaProc", ExportUtils.Align.center, "", "#c12f2f", "#ffffff", false), new ExportUtils.ExportUtilDatos("Fecha Efectiva", "SFechaEfect", ExportUtils.Align.center, "", "#c12f2f", "#ffffff", false), new ExportUtils.ExportUtilDatos("Referencia", "SChqRef", ExportUtils.Align.center, "", "#c12f2f", "#ffffff", false), new ExportUtils.ExportUtilDatos("Descripción", "SDesctrans", ExportUtils.Align.left, "", "#c12f2f", "#ffffff", false), new ExportUtils.ExportUtilDatos("Monto", "SMonto", ExportUtils.Align.right, "", "#c12f2f", "#ffffff", false) }; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("<table>"); stringBuilder.Append("<tr>"); stringBuilder.Append("<td><b>Fecha:</b></td>"); DateTime now = DateTime.Now; stringBuilder.Append(string.Concat("<td style='text-align:center;'>", now.ToString("dd/MM/yyyy"), "</td>")); stringBuilder.Append("</tr>"); stringBuilder.Append("<tr>"); stringBuilder.Append("<td><b>Criterio seleccionado:</b></td>"); stringBuilder.Append(string.Concat("<td style='text-align:center;'>", this.liCritero.Text, "</td></tr>")); stringBuilder.Append("</table>"); string[] afiliado = new string[] { "Movimientos_", base.Afiliado.sCedula, "_", null, null }; afiliado[3] = DateTime.Now.ToString("ddMMyyyyhhmmss"); afiliado[4] = ".xls"; ExportUtils.Export2Excel(string.Concat(afiliado), stringBuilder.ToString(), dataTable, exportUtilDatos); } }
protected void ddlCtaAcreditar_SelectedIndexChanged(object sender, EventArgs e) { this.liSaldoActual.Text = "0,00"; this.liPagoMinimo.Text = "0,00"; this.txtTarjetaPagar.Text = string.Empty; this.TxtCorreo.Text = string.Empty; this.txtOtroMonto.Text = "0,00"; this.BtAceptar.Enabled = false; this.panelTipoPago.Enabled = false; bool flag = false; if (this.ddlCtaAcreditar.SelectedIndex > 0) { if (base.sCod == 13) { string sNroCuenta = this.ddlCtaAcreditar.getCuenta().SNroCuenta; try { RespuestaContdcdsjv respuestaContdcdsjv = HelperIbs.ibsConSaldoTdc(base.Afiliado.AF_CodCliente, base.Afiliado.sAF_Rif, sNroCuenta); TextBox str = this.txtFechaPago; DateTime fecha = Formatos.ISOToFecha(respuestaContdcdsjv.contdcdsjv.SFechaProxPgo); str.Text = fecha.ToString("dd/MM/yyyy"); this.liPagoMinimo.Text = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaContdcdsjv.contdcdsjv.SCuotaMes)); this.liSaldoActual.Text = Formatos.formatoMonto(Formatos.ISOToDecimal(respuestaContdcdsjv.contdcdsjv.SSaldoActual)); if (this.Context.Items["TipoTransaccionGenerica"] != null) { TipoTransaccionGenerica item = this.Context.Items["TipoTransaccionGenerica"] as TipoTransaccionGenerica; GTransferenciasPagos objetoTransaccion = (GTransferenciasPagos)item.ObjetoTransaccion; if (objetoTransaccion.RdoSelected == 1) { this.rb_actual.Checked = true; } if (objetoTransaccion.RdoSelected == 2) { this.rb_minimo.Checked = true; } if (objetoTransaccion.RdoSelected == 3) { this.rb_otro.Checked = true; this.txtMonto.Text = Formatos.formatoMonto(objetoTransaccion.Monto).Replace(".", ""); } } this.UpdatePanel1.Update(); flag = true; } catch (IBException bException) { WebUtils.MessageBox2005(this, "Sistema de consulta de saldos de tarjetas de créditos no disponible en este momento, por favor intente más tarde."); return; } catch (Exception exception) { WebUtils.MessageBox2005(this, exception.Message); return; } } else { AfiliadoFavorito afiliadoFavorito = this.ddlCtaAcreditar.getAfiliadoFavorito(); this.txtTarjetaPagar.Text = afiliadoFavorito.NumeroInstrumento; this.TxtCorreo.Text = afiliadoFavorito.Email.Trim(); flag = true; } if (flag) { this.panelTipoPago.Enabled = true; this.BtAceptar.Enabled = true; } } }