148 lines
6.5 KiB
VB.net
148 lines
6.5 KiB
VB.net
Imports System.Data
|
|
Imports Extensiones
|
|
Partial Class Bancos_RepSaldosDAP
|
|
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
|
|
|
|
Private Sub Bancos_RepSaldosDAP_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If UsuarioActual.TienePermisoProceso(91) Then
|
|
DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("", "Nombre") 'GlobalDTUsuarioResponsable.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
DdlUsuarioRegistro.DataBind()
|
|
DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
Else
|
|
DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
DdlUsuarioRegistro.DataBind()
|
|
End If
|
|
|
|
DdlProveedoresClasificaciones.DataSource = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa)
|
|
DdlProveedoresClasificaciones.DataBind()
|
|
|
|
'Dim objPersonal As New ClsRH
|
|
'If objPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
|
|
' DdlPersonal.DataSource = objPersonal.DtResultados
|
|
' DdlPersonal.DataBind()
|
|
'End If
|
|
'objPersonal.Dispose()
|
|
|
|
DdlMoneda.DataSource = GlobalDTMonedas
|
|
DdlMoneda.DataBind()
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim Mov As New ClsMovimientos
|
|
Dim FechaI, FechaF As Date
|
|
|
|
If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text.ToDate Else FechaI = MinFecha
|
|
If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text.ToDate Else FechaF = MaxFecha
|
|
|
|
If Mov.GetSaldosDeudorAcreedorAnticipos(FechaI, FechaF, DdlDAP.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlUsuarioResponsable.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then
|
|
DtDatos = Mov.DtResultados
|
|
GvESC.DataSource = DtDatos.FiltraParametros("CveProveedor IS NOT NULL")
|
|
UPDatos.Update()
|
|
End If
|
|
|
|
|
|
Mov.Dispose()
|
|
|
|
GvESC.DataBind()
|
|
End Sub
|
|
|
|
Protected Sub BtnCargarProveedores_Click(sender As Object, e As System.EventArgs) Handles BtnCargarProveedores.Click
|
|
DdlProveedores.CssClass += " select2me"
|
|
DdlProveedores.Items.Clear()
|
|
DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
|
|
|
DdlProveedores.DataBind()
|
|
DdlProveedores.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
DdlProveedores.Attributes.Remove("onclick")
|
|
End Sub
|
|
|
|
Protected Sub GvESC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvESC.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
If e.Row.DBCampo("CveProveedor") = "" Then
|
|
e.Row.BackColor = Drawing.Color.LightGray
|
|
' e.Row.FCHyperLink("ImgAbonar").Visible = False
|
|
e.Row.FCHyperLink("Hpl").NavigateUrl = ""
|
|
e.Row.FCHyperLink("Hpl").Font.Bold = True
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
|
|
End If
|
|
|
|
If e.Row.RowIndex = 1 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(520)
|
|
e.Row.Cells(1).Width = Unit.Pixel(50)
|
|
e.Row.Cells(2).Width = Unit.Pixel(100)
|
|
e.Row.Cells(3).Width = Unit.Pixel(150)
|
|
e.Row.Cells(5).Width = Unit.Pixel(100)
|
|
End If
|
|
|
|
'Sustituido 3-5 lineas mas abajo
|
|
'If e.Row.DBCampo("FechaDocumento") = "" Then e.Row.BackColor = Drawing.Color.LightGray
|
|
|
|
'CUANDO ES SUBTITULO
|
|
If e.Row.DBCampo("CveIE") = "" Then
|
|
|
|
If e.Row.DBCampo("CveMoneda") = "" Then
|
|
e.Row.CssClass = "SubTotales2"
|
|
Else
|
|
e.Row.CssClass = "SubTotales"
|
|
e.Row.FCLiteral("LtMoneda").Visible = True
|
|
e.Row.FCHyperLink("Hpl").Visible = False
|
|
End If
|
|
|
|
End If
|
|
|
|
'LINK A IE
|
|
If e.Row.DBCampo("Folio") <> "" Then
|
|
e.Row.FCHyperLink("HLFolio").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
|
|
End If
|
|
|
|
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(1).ForeColor = Drawing.Color.Red
|
|
' e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/ProveedoresAbonar.aspx?CveProveedor={0}&FechaI={1}&FechaF={2}&CveUsuarioProgramo={3}&CveMoneda={4}&Serie={5}", e.Row.DBCampo("CveProveedor"), If(txtFechaI.Text <> "", txtFechaI.Text, "-1"), If(txtFechaF.Text <> "", txtFechaF.Text, "-1"), DdlUsuarioProgramo.SelectedValue, e.Row.DBCampo("CveMoneda"), e.Row.DBCampo("Serie"))
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
#Region "O R D E N A M I E N T O"
|
|
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
|
Dim Orden As String = ""
|
|
Dim Campo As String = ""
|
|
Dim Literal As Literal = Nothing
|
|
Const OrdenInicial As String = ""
|
|
Dim Arg(2) As String
|
|
|
|
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
|
Campo = Arg(0)
|
|
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
|
Campo = Campo.Substring(0, Campo.Length - 1)
|
|
|
|
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
|
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
|
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
|
Else
|
|
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
|
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
|
End If
|
|
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
|
ViewState("Orden") = Orden
|
|
'CargaGv(Orden)
|
|
End Sub
|
|
|
|
'Protected Sub CargaGv(Orden As String)
|
|
' CargaGrid(Orden)
|
|
'End Sub
|
|
#End Region
|
|
End Class
|