que guarde en aplicacion el Tipo de cambio del dia, y no lo este consultando en la BD
This commit is contained in:
@@ -460,7 +460,7 @@ Partial Class Site
|
|||||||
'End If
|
'End If
|
||||||
'OC.Dispose()
|
'OC.Dispose()
|
||||||
|
|
||||||
LtlMNotificaciones.Text = LtlMNotificaciones.Text & Notificaciones.ToString
|
LtlMNotificaciones.Text = String.Format("{0}{1}", LtlMNotificaciones.Text, Notificaciones.ToString)
|
||||||
Notificaciones.Clear()
|
Notificaciones.Clear()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -494,11 +494,41 @@ Partial Class Site
|
|||||||
|
|
||||||
#Region "TIPO DE CAMBIO"
|
#Region "TIPO DE CAMBIO"
|
||||||
Private Sub CargaTipoCambio()
|
Private Sub CargaTipoCambio()
|
||||||
|
|
||||||
|
If Application("TipoCambioActual") Is Nothing Then
|
||||||
|
'sino existe el dato, lo carga por ser la primera vez
|
||||||
|
Application("TipoCambioActual") = GetTipoCambio()
|
||||||
|
Else
|
||||||
|
Dim TCA As TipoCambioActual = CType(Application("TipoCambioActual"), TipoCambioActual)
|
||||||
|
If TCA.Fecha <> DateTime.Today Then
|
||||||
|
Application("TipoCambioActual") = GetTipoCambio()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
lblTipoCambio.Text = String.Format(" | TC {0:C4}", CType(Application("TipoCambioActual"), TipoCambioActual).TipoCambio)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function GetTipoCambio() As TipoCambioActual
|
||||||
|
Dim Retorno As TipoCambioActual = Nothing
|
||||||
|
|
||||||
|
'sino existe el dato, lo carga por ser la primera vez
|
||||||
Dim ObjGenerales As ClsGenerales = New ClsGenerales
|
Dim ObjGenerales As ClsGenerales = New ClsGenerales
|
||||||
If ObjGenerales.GetTipoCambio(-1, DateTime.Now) And ObjGenerales.DtResultados.Rows.Count > 0 Then
|
If ObjGenerales.GetTipoCambio(-1, DateTime.Today) And ObjGenerales.DtResultados.Rows.Count > 0 Then
|
||||||
lblTipoCambio.Text = String.Format(" | TC {0:C4}", ObjGenerales.DtResultados(0)("TipoCambio").ToString().ToDecimal())
|
'lblTipoCambio.Text = String.Format(" | TC {0:C4}", ObjGenerales.DtResultados(0)("TipoCambio").ToString().ToDecimal())
|
||||||
|
If ObjGenerales.DtResultados.Rows.Count > 0 Then
|
||||||
|
Retorno = New TipoCambioActual With {.Fecha = DateTime.Today, .TipoCambio = ObjGenerales.DtResultados(0)("TipoCambio").ToString().ToDecimal()}
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
ObjGenerales.Dispose()
|
ObjGenerales.Dispose()
|
||||||
End Sub
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
End Class
|
||||||
|
Public Class TipoCambioActual
|
||||||
|
Public Fecha As Date
|
||||||
|
Public TipoCambio As Decimal
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user