125 lines
4.9 KiB
VB.net
125 lines
4.9 KiB
VB.net
Imports System.Data
|
|
Imports Extensiones
|
|
|
|
Partial Class RepEvaluacionProveedor
|
|
Inherits ClsPaginas
|
|
|
|
Private Sub RepEvaluacionProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
|
|
If Not Page.IsPostBack Then
|
|
|
|
' GV.HeaderRow.TableSection = TableRowSection.TableHeader
|
|
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
|
DdlProveedor.DataBind()
|
|
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
Dim dNow As Date = NowADS()
|
|
TxtFechaF.Text = dNow.ToString("dd/MM/yyyy")
|
|
dNow = dNow.AddDays(-30)
|
|
TxtFechaI.Text = dNow.ToString("dd/MM/yyyy")
|
|
|
|
DdlCveClasificacionProveedor.DataSource = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa)
|
|
DdlCveClasificacionProveedor.DataBind()
|
|
DdlCveClasificacionProveedor.Items.Insert(0, New ListItem("Sin Clasificación", "-1"))
|
|
|
|
|
|
cargaDatos()
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
|
cargaDatos()
|
|
End Sub
|
|
|
|
Private Sub cargaDatos()
|
|
|
|
Dim fInicio As Date = Date.Parse(TxtFechaI.Text)
|
|
Dim fFin As Date = Date.Parse(TxtFechaF.Text)
|
|
|
|
Dim objCompras As New ClsCompras
|
|
objCompras.GetRepEvaluacionProveedores(UsuarioActual.Empresa.CveEmpresa, DdlProveedor.SelectedValue.ToEntero, DdlCveClasificacionProveedor.SelectedValue.ToEntero, fInicio, fFin)
|
|
GV.DataSource = objCompras.DtResultados
|
|
LtlTotalRegistros.Text = objCompras.DtResultados.Rows.Count.ToString
|
|
|
|
GV.DataBind()
|
|
UPDatos.Update()
|
|
upContador.Update()
|
|
|
|
objCompras.Dispose()
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
|
|
|
|
Dim Liga As String = String.Empty
|
|
If (e.Row.DBCampo("ReqCve").ToString <> "") Then
|
|
Liga = String.Format("<a class='Texto' href='javascript:IrO(""{0}"");'>", e.Row.DBCampo("ReqCve"))
|
|
e.Row.FCLabel("lblReqFolio").Text = String.Format("<div >{0}{1}</a></div>", Liga, e.Row.DBCampo("ReqFolio"))
|
|
End If
|
|
|
|
If e.Row.DBCampo("OcCve").ToString <> "" Then
|
|
Liga = String.Format("<a class='Texto' href='javascript:IrO(""{0}"");'>", e.Row.DBCampo("OcCve"))
|
|
e.Row.FCLabel("lblOcFolio").Text = String.Format("<div >{0}{1}</a></div>", Liga, e.Row.DBCampo("OcFolio"))
|
|
End If
|
|
|
|
Liga = String.Format("<a class='Texto' href='javascript:IrP(""{0}"");'>", e.Row.DBCampo("CveProveedor"))
|
|
e.Row.FCLabel("lblProveedor").Text = String.Format("<div >{0}{1}</a></div>", Liga, e.Row.DBCampo("NombreComercial"))
|
|
|
|
'Liga = String.Format("<a class='Texto' href='javascript:IrC(""{0}"");'>", e.Row.DBCampo("CveCompra"))
|
|
'e.Row.FCLabel("lblReqFolio").Text = String.Format("<div >{0}{1}</a></div>", Liga, e.Row.DBCampo("ReqFolio"))
|
|
|
|
Dim atraso As Integer = e.Row.DBCampo("Atraso").Trim.ToEntero
|
|
e.Row.FCLabel("lblAtraso").Font.Bold = True
|
|
e.Row.FCLabel("lblAtraso").Text = atraso.ToString
|
|
e.Row.FCLabel("lblAtraso").Width = 70
|
|
|
|
If atraso > 0 Then
|
|
e.Row.FCLabel("lblAtraso").CssClass = "label label-danger"
|
|
Else
|
|
e.Row.FCLabel("lblAtraso").CssClass = "label label-success"
|
|
End If
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
|
GV.ExportToExcel("Evaluacion_proveedores")
|
|
End Sub
|
|
Protected Sub GV_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GV.RowCreated
|
|
|
|
'If (e.Row.RowType = DataControlRowType.Header) Then
|
|
|
|
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
|
|
' Dim HeaderGridRow As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
|
|
' Dim HeaderCell As New TableCell()
|
|
|
|
' HeaderCell.Text = "Requisición"
|
|
' HeaderCell.ColumnSpan =
|
|
' HeaderGridRow.Cells.Add(HeaderCell)
|
|
|
|
' HeaderCell = New TableCell()
|
|
' HeaderCell.Text = "Orden de Compra"
|
|
' HeaderCell.ColumnSpan = 3
|
|
' HeaderGridRow.Cells.Add(HeaderCell)
|
|
|
|
' HeaderCell = New TableCell()
|
|
' HeaderCell.Text = "Compra"
|
|
' HeaderCell.ColumnSpan = 3
|
|
' HeaderGridRow.Cells.Add(HeaderCell)
|
|
|
|
' HeaderGrid.CssClass = "correcto table table-smallpadding Widthall"
|
|
' GV.Controls(0).Controls.AddAt(0, HeaderGridRow)
|
|
|
|
'End If
|
|
|
|
End Sub
|
|
End Class
|