96 lines
3.6 KiB
VB.net
96 lines
3.6 KiB
VB.net
|
|
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports Extensiones
|
|
|
|
Partial Class Compras_RepComprasG
|
|
Inherits ClsPaginas
|
|
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
CargaCombos()
|
|
CargaDatos()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaCombos()
|
|
'CargaProveedores
|
|
'Dim ObjProveedores As New ClsCompProveedores
|
|
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
|
' DdlProveedores.DataSource = ObjProveedores.DtResultados
|
|
'Else
|
|
' DdlProveedores.DataSource = Nothing
|
|
'End If
|
|
'ObjProveedores.Dispose()
|
|
'DdlProveedores.DataBind()
|
|
DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
|
DdlProveedores.DataBind()
|
|
|
|
'TxtFechaICaptura.Text = NowADS().AddMonths(-1).FirstDayOfMonth.ToShortDateString
|
|
'TxtFechaFCaptura.Text = NowADS().ToShortDateString
|
|
|
|
DDlUsuarioCaptura.DataSource = GlobalDTUsuarioResponsable(UsuarioActual.CveEmpresa)
|
|
DDlUsuarioCaptura.DataBind()
|
|
|
|
DdlEstatusCompra.DataSource = GlobalDTCompEstatusFactura.FiltraParametros("CveEstatusFactura IN (1,2)")
|
|
DdlEstatusCompra.DataBind()
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
'Dim ObjCompras As New ClsCompras()
|
|
|
|
|
|
''Dim FechaICaptura, FechaFCaptura As String
|
|
''FechaICaptura = If(IsDate(TxtFechaICaptura.Text.Trim()), TxtFechaICaptura.Text.Trim(), "-1")
|
|
''FechaFCaptura = If(IsDate(TxtFechaFCaptura.Text.Trim()), TxtFechaFCaptura.Text.Trim(), "-1")
|
|
|
|
'Dim FechaI, FechaF As String
|
|
'FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate.ToString("yyyy/MM/dd"), "-1")
|
|
'FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate.ToString("yyyy/MM/dd"), "-1")
|
|
|
|
''FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
|
|
'If ObjCompras.GetRepComprasG(DdlProveedores.SelectedValue.ToEntero, DdlEstatusCompra.SelectedValue.ToEntero, FechaI, FechaF, DDlUsuarioCaptura.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
' GvDatos.DataSource = ObjCompras.DtResultados
|
|
'Else
|
|
' GvDatos.DataSource = Nothing
|
|
'End If
|
|
'ObjCompras.Dispose()
|
|
'GvDatos.DataBind()
|
|
'UPDatos.Update()
|
|
End Sub
|
|
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = 300
|
|
e.Row.Cells(1).Width = 75
|
|
e.Row.Cells(2).Width = 100
|
|
e.Row.Cells(3).Width = 65
|
|
e.Row.Cells(4).Width = 75
|
|
e.Row.Cells(5).Width = 75
|
|
e.Row.Cells(6).Width = 65
|
|
e.Row.Cells(7).Width = 65
|
|
e.Row.Cells(8).Width = 75
|
|
e.Row.Cells(9).Width = 75
|
|
e.Row.Cells(10).Width = 65
|
|
End If
|
|
|
|
If e.Row.DBCampo("CveCompra").ToEntero = 0 Then
|
|
e.Row.CssClass = "SubTotales"
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
|
GvDatos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
|
End Sub
|
|
|
|
End Class
|