Cambio para llenar los años sin usar la base de datos
This commit is contained in:
@@ -9,6 +9,7 @@ Partial Class Acumuladores_RepEntradasUsados
|
|||||||
|
|
||||||
Private DiasSemana(7) As String
|
Private DiasSemana(7) As String
|
||||||
Private Meses(12) As String
|
Private Meses(12) As String
|
||||||
|
Private Cargado As Integer = 0
|
||||||
|
|
||||||
Private Property DatosEntradasUsados() As DataTable
|
Private Property DatosEntradasUsados() As DataTable
|
||||||
Get
|
Get
|
||||||
@@ -25,8 +26,6 @@ Partial Class Acumuladores_RepEntradasUsados
|
|||||||
txtFechaF.Text = Today
|
txtFechaF.Text = Today
|
||||||
CargarDatos()
|
CargarDatos()
|
||||||
CargarCombos()
|
CargarCombos()
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -36,14 +35,18 @@ Partial Class Acumuladores_RepEntradasUsados
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub CargarCombos()
|
Protected Sub CargarCombos()
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
|
||||||
Dim fecha As Date = Date.Now.AddMonths(-1)
|
Dim fecha As Date = Date.Now.AddMonths(-1)
|
||||||
ObjAcum.GetAñosVentas(UsuarioActual.CveEmpresa)
|
Dim Años As New ListItem
|
||||||
DdlAño.DataSource = ObjAcum.DtResultados
|
Dim i As Integer
|
||||||
DdlAño.DataBind()
|
If Cargado = 0 Then
|
||||||
DdlAño.SelectedValue = fecha.Year.ToEntero
|
For i = Date.Now.Year.ToEntero To (fecha.Year.ToEntero - 5) Step -1
|
||||||
ObjAcum.Dispose()
|
Años = New ListItem(i, i)
|
||||||
|
DdlAño.Items.Add(Años)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Cargado = 1
|
||||||
|
|
||||||
|
DdlAño.SelectedValue = fecha.Year.ToEntero
|
||||||
DdlMes.SelectedValue = fecha.Month.ToEntero
|
DdlMes.SelectedValue = fecha.Month.ToEntero
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -1206,20 +1206,6 @@ Public Class ClsAcumuladores
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetAñosVentas(CveEmprea As Integer) As Boolean
|
|
||||||
Dim Retorno As Boolean = False
|
|
||||||
SqlDataAdapter(String.Format("select top 6 year(Fecha) as Año from Ventas where CveEmpresa = {0} group by year(Fecha) Order by year(Fecha) desc", CveEmprea.ToString), CommandType.Text)
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
Retorno = True
|
|
||||||
Catch ex As Exception
|
|
||||||
OnError(String.Format("Ocurrió un error al consultar los año de venta"), ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
|
||||||
End Try
|
|
||||||
Return Retorno
|
|
||||||
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
#Region " IDisposable Support "
|
#Region " IDisposable Support "
|
||||||
' IDisposable
|
' IDisposable
|
||||||
|
|||||||
Reference in New Issue
Block a user