Commit inicial Ventas Productivo
This commit is contained in:
111
Compras/RepPerioricidad.aspx.vb
Normal file
111
Compras/RepPerioricidad.aspx.vb
Normal file
@@ -0,0 +1,111 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Compras_RepPerioricidad
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
'divfiltros.Attributes.CssStyle.Add("display", "none")
|
||||
RegistraScript(String.Format("$('#{0}').css({{'display':'none'}});", divfiltros.ClientID))
|
||||
|
||||
txtFechaI.Text = Now.AddMonths(-6).ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
CargaCombos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim ObjCompras As New ClsCompras
|
||||
If ObjCompras.GetRepComprasPerioricidad(DdlSubProyecto.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa) Then
|
||||
DtDatos = ObjCompras.DtResultados
|
||||
Gv.DataSource = DtDatos
|
||||
Else
|
||||
Gv.DataSource = Nothing
|
||||
End If
|
||||
ObjCompras.Dispose()
|
||||
Gv.DataBind()
|
||||
UPPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub Gv_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles Gv.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DataKey("TipoRenglon").ToEntero = 1 Then
|
||||
'e.Row.FindControl("LblSpace").Visible = False
|
||||
e.Row.FindControl("tr2").Visible = False
|
||||
e.Row.CssClass = "Totales"
|
||||
ElseIf e.Row.DataKey("TipoRenglon").ToEntero = 2 Then
|
||||
'e.Row.FCLiteral("LblAgrupador").Text = String.Format(" {0}", e.Row.DBCampo("Agrupador"))
|
||||
e.Row.FindControl("tr2").Visible = False
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
'e.Row.FindControl("tdConcepto")
|
||||
e.Row.Cells(0).Style.Add("padding-left", "15px;")
|
||||
Else
|
||||
e.Row.FindControl("tr1").Visible = False
|
||||
'e.Row.BackColor = Drawing.Color.LightSkyBlue
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.CveEmpresa)
|
||||
DdlProyecto.DataBind()
|
||||
If DdlProyecto.Items.Count > 0 Then
|
||||
DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlPS.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
'DdlClasificacion.DataBind()
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||
Else
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
End If
|
||||
DdlClasificacion.DataBind()
|
||||
|
||||
If DdlClasificacion.Items.Count > 0 Then
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS(CveClasificacion As Integer)
|
||||
|
||||
DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion)
|
||||
DdlPS.DataBind()
|
||||
|
||||
If DdlPS.Items.Count > 0 Then
|
||||
DdlPS.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
If DdlSubProyecto.Items.Count > 0 Then
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPS(DdlClasificacion.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user