84 lines
2.5 KiB
VB.net
84 lines
2.5 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
Partial Class Compras_RepImportaciones
|
|
Inherits ClsPaginas
|
|
|
|
#Region "PROPIEDADES"
|
|
Private Property DtImportaciones As DataTable
|
|
Get
|
|
Return CType(ViewState("DtImportaciones"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DtImportaciones") = value
|
|
End Set
|
|
End Property
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
|
|
InicializaValores()
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub InicializaValores()
|
|
TxtFechaI.Text = Date.Now.AddDays(-Now.DayOfYear + 1).ToShortDateString
|
|
TxtFechaF.Text = Date.Now.ToShortDateString
|
|
|
|
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
|
DdlProveedor.DataBind()
|
|
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
'DdlAF.DataSource = GlobalDTActivoFijos
|
|
'DdlAF.DataBind()
|
|
'DdlAF.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
|
|
|
|
#Region " CARGA DAATOS "
|
|
|
|
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim ObjImportaciones As New ClsCompras
|
|
Dim FechaI, FechaF As String
|
|
|
|
If TxtFechaI.Text <> "" Then FechaI = TxtFechaI.Text Else FechaI = "-1"
|
|
If TxtFechaF.Text <> "" Then FechaF = TxtFechaF.Text Else FechaF = "-1"
|
|
|
|
If ObjImportaciones.GetImportaciones(-1, DdlProveedor.SelectedValue.ToString.ToEntero, -1, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero) Then
|
|
DtImportaciones = ObjImportaciones.DtResultados
|
|
Else
|
|
Alert("Ocurrió un error al cargar las importaciones", TipoMensaje.MsgError)
|
|
End If
|
|
ObjImportaciones.Dispose()
|
|
|
|
CargaGrid()
|
|
End Sub
|
|
|
|
Private Sub CargaGrid()
|
|
GvDatos.DataSource = DtImportaciones
|
|
GvDatos.DataBind()
|
|
UpDatos.Update()
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
e.Row.FCLiteral("Consecutivo").Text = (GvDatos.Rows.Count + 1).ToString
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
|
|
|
|
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs)
|
|
GvDatos.ExportToExcel("Reporte de Importaciones")
|
|
End Sub
|
|
|
|
End Class
|