Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub LoadGrdRendDoc(id_doc As String)
- 'cartera.Rend_Ret_Val_Rend_X_Doc(id_doc, año, mes, Val)
- Dim factor_cambio As Double = 1.0
- Dim DS As DataSet
- Dim dt As New DataTable()
- Dim clsvali As New WS_Validacion.ValidacionesClient
- divRend2Sec.CssClass = "divRend2SecMod"
- divRend2Prin.CssClass = "divRend2PrinEdit"
- lblSecYear1.Text = "Reporte AÑO " + ddlSecPeriodo1.SelectedValue.ToString()
- lblSecYear2.Text = "Reporte AÑO " + ddlSecPeriodo2.SelectedValue.ToString()
- Dim descripcion(0 To 8) As String
- Try
- 'Generadatatable(dt)
- Dim dr As DataRow = Nothing
- dt.Columns.Add(New DataColumn("DESC", GetType(String)))
- dt.Columns.Add(New DataColumn("ENE", GetType(String)))
- dt.Columns.Add(New DataColumn("FEB", GetType(String)))
- dt.Columns.Add(New DataColumn("MAR", GetType(String)))
- dt.Columns.Add(New DataColumn("ABR", GetType(String)))
- dt.Columns.Add(New DataColumn("MAY", GetType(String)))
- dt.Columns.Add(New DataColumn("JUN", GetType(String)))
- dt.Columns.Add(New DataColumn("JUL", GetType(String)))
- dt.Columns.Add(New DataColumn("AGO", GetType(String)))
- dt.Columns.Add(New DataColumn("SEP", GetType(String)))
- dt.Columns.Add(New DataColumn("OCT", GetType(String)))
- dt.Columns.Add(New DataColumn("NOV", GetType(String)))
- dt.Columns.Add(New DataColumn("DIC", GetType(String)))
- dt.Columns.Add(New DataColumn("TOT", GetType(String)))
- dr = dt.NewRow()
- descripcion(0) = "(+)Ingresos Financiero"
- descripcion(1) = "(-)Transferencia"
- descripcion(2) = "(-)Spread Compartido"
- descripcion(3) = "Margen Bruto"
- descripcion(4) = "(+)Inof"
- descripcion(5) = "Margen Neto"
- descripcion(6) = "Saldo Promedio"
- descripcion(7) = "Tasa Implícita"
- descripcion(8) = "Rendimiento"
- pnlSecRangos.CssClass = "visible"
- pnlSecRenPeriodos.CssClass = "visible"
- 'factor_cambio = clsvali.Uso_Servicio_Core_FCT3001R_double("USD", "")
- factor_cambio = 336.0
- For i = 0 To 8
- Dim valores(0 To 13) As String
- valores(0) = descripcion(i)
- Dim tot As Single = 0.0
- 'dr("Mes") = DS.Tables(0).Rows(i)("DESC").ToString()
- For j = 0 To 11
- 'DS = cartera.Rend_Ret_Val_Rend(prod, j + 1, año1, i + 1, rol, cli, mon, eje)
- DS = cartera.Rend_Ret_Val_Rend_X_Doc(id_doc, Year(Now), j + 1, i + 1)
- If DS IsNot Nothing Then
- If DS.Tables(0).Rows.Count > 1 Then
- Dim sum_mon As Single = 0.0
- For k = 0 To DS.Tables(0).Rows.Count - 1
- If DS.Tables(0).Rows(k)("par_mon") = "3" Then
- sum_mon = Double.Parse((DS.Tables(0).Rows(k)("DESC") * factor_cambio).ToString()) + sum_mon
- Else
- sum_mon = Double.Parse(DS.Tables(0).Rows(k)("DESC").ToString()) + sum_mon
- End If
- Next
- valores(j + 1) = DS.Tables(0).Rows(0)("DESC").ToString()
- tot = tot + Single.Parse(DS.Tables(0).Rows(0)("DESC").ToString())
- 'dt.Rows.Add(dr)
- 'dt.Rows.Add(desc, valor)
- 'grdSecRendperAnual1.Columns = dt.Columns
- Else
- valores(j + 1) = FormatNumber(Double.Parse(DS.Tables(0).Rows(0)("DESC").ToString()), 1)
- tot = tot + FormatNumber(Single.Parse(DS.Tables(0).Rows(0)("DESC").ToString()), 1)
- End If
- End If
- Next
- valores(13) = tot
- 'For k = 0 To 11
- dt.Rows.Add(valores)
- 'Next
- 'dt.LoadDataRow(valores, True)
- 'Next
- 'grdSecRendperAnual1.DataSource = dt
- 'grdSecRendperAnual1.DataBind()
- Next
- grdTerRendperAnualDoc.DataSource = dt
- grdTerRendperAnualDoc.DataBind()
- dt.Clear()
- 'grdSecRendperAnual1.ControlStyle.Font.Size = 20
- Catch ex As Exception
- rut.Mensaje(UpdatePanel1, "Error al Cargar desde BD")
- End Try
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement