124 lines
5.3 KiB
VB.net
124 lines
5.3 KiB
VB.net
Imports Extensiones
|
|
Imports System.Data
|
|
|
|
Partial Class RepContratosAvances
|
|
Inherits ClsPaginas
|
|
|
|
|
|
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
|
|
CargaClientes()
|
|
CargaContratos()
|
|
|
|
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
|
DdlClasificacion.DataBind()
|
|
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
cargaPS()
|
|
|
|
|
|
'DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
|
|
|
CargaDatos()
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Private Sub CargaDatos()
|
|
Dim Con As New ClsContratos
|
|
If Con.GetRepContratosAvances(DdlCliente.SelectedValue.ToEntero, DdlContrato.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
GV.DataSource = Con.DtResultados
|
|
GV.DataBind()
|
|
'If Con.DtResultados.Rows.Count > 0 Then
|
|
' BtnAgregar.Visible = True
|
|
'End If
|
|
UpDatos.Update()
|
|
End If
|
|
Con.Dispose()
|
|
End Sub
|
|
|
|
#Region "C O M B O S"
|
|
|
|
|
|
Private Sub CargaContratos()
|
|
DdlContrato.DataSource = GlobalDTContratos(UsuarioActual.CveEmpresa)
|
|
DdlContrato.DataBind()
|
|
DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
|
End Sub
|
|
|
|
Private Sub CargaClientes()
|
|
Dim dt As DataTable = Nothing
|
|
Dim Cli As New ClsClientes
|
|
If Cli.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
|
dt = Cli.DtResultados
|
|
End If
|
|
Cli.Dispose()
|
|
DdlCliente.DataSource = dt
|
|
DdlCliente.DataBind()
|
|
DdlCliente.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(60)
|
|
e.Row.Cells(1).Width = Unit.Pixel(300) 'SubSeccion
|
|
e.Row.Cells(2).Width = Unit.Pixel(120) 'Cantidad
|
|
e.Row.Cells(3).Width = Unit.Pixel(120) 'Cantidad
|
|
e.Row.Cells(4).Width = Unit.Pixel(120) 'Cantidad
|
|
e.Row.Cells(5).Width = Unit.Pixel(120) 'Cantidad
|
|
e.Row.Cells(6).Width = Unit.Pixel(120) 'Cantidad
|
|
|
|
End If
|
|
|
|
'If e.Row.DBCampo("RazonSocial") = "" Then
|
|
' e.Row.CssClass = "Totales" : e.Row.Height = 25
|
|
If e.Row.DBCampo("NumeroContrato") = "" Then
|
|
e.Row.CssClass = "SubTotales2" : e.Row.Height = 25
|
|
ElseIf e.Row.DBCampo("Partida") = "" Then
|
|
e.Row.CssClass = "SubTotales" : e.Row.Height = 25
|
|
'ElseIf e.Row.DBCampo("Clasificacion") = "" Then
|
|
' e.Row.CssClass = "SubTotales3" : e.Row.Height = 25
|
|
End If
|
|
|
|
If e.Row.DBCampo("CveContrato") <> "" Then
|
|
e.Row.FCHyperLink("HplAgrupador").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=Con&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
|
e.Row.FCHyperLink("HplContratado").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=Con&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
|
e.Row.FCHyperLink("HplActual").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=Act&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
|
e.Row.FCHyperLink("HPlPorEstimar").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=XEst&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
|
e.Row.FCHyperLink("HplEjecutado").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=Eje&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
|
e.Row.FCHyperLink("HplOFA").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=OFA&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
|
End If
|
|
|
|
' If e.Row.DBCampo("OriginalvsReal").ToDouble < 0 Then e.Row.FCLabel("LblOrigVsReal").ForeColor = Drawing.Color.Red
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub CmdConsultar_Click(sender As Object, e As EventArgs) Handles CmdConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
|
|
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
|
cargaPS()
|
|
End Sub
|
|
|
|
Private Sub cargaPS()
|
|
Dim dt As DataTable = Nothing
|
|
Dim PS As New ClsProductosServicios
|
|
If PS.GetPS(-1, DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
dt = PS.DtResultados.FiltraParametros("", "PS")
|
|
End If
|
|
|
|
PS.Dispose()
|
|
|
|
DdlPS.DataSource = dt
|
|
DdlPS.DataBind()
|
|
DdlPS.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
End Class
|