Commit inicial Ventas Productivo
This commit is contained in:
106
Bancos/PopUpBuscarIE.aspx.vb
Normal file
106
Bancos/PopUpBuscarIE.aspx.vb
Normal file
@@ -0,0 +1,106 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class Bancos_PopUpBuscarIE
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Opcion As String
|
||||
Get
|
||||
Return ViewState("Opcion").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Opcion") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 600
|
||||
RegistraScript("$get('tdContenido').style.height='520px'")
|
||||
Opcion = "-1"
|
||||
|
||||
If Request("OPCION") IsNot Nothing AndAlso Request("OPCION").ToString <> "" Then
|
||||
Opcion = Request("OPCION").ToString
|
||||
End If
|
||||
|
||||
txtFechaI.Text = Date.Now.AddMonths(-1).FirstDayOfMonth.ToShortDateString
|
||||
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " C A R G A - D A T O S"
|
||||
Private Sub CargaDatos()
|
||||
CargaBanco()
|
||||
CargaCuenta()
|
||||
End Sub
|
||||
Private Sub CargaBanco()
|
||||
DdlBanco.DataSource = GlobalDTBancos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlBanco.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaCuenta()
|
||||
DdlCuenta.Items.Clear()
|
||||
DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveBanco = '" & DdlBanco.SelectedValue.ToEntero & "'")
|
||||
DdlCuenta.DataBind()
|
||||
DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
Protected Sub DdlBanco_SelectedIndexChanged1(sender As Object, e As System.EventArgs) Handles DdlBanco.SelectedIndexChanged
|
||||
CargaCuenta()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
||||
Dim ObjBancosIE As New ClsBancos
|
||||
Dim Folio As String = "-1"
|
||||
If TxtFolio.Text <> "" Then Folio = String.Format("%{0}%", TxtFolio.Text.Trim)
|
||||
|
||||
If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate, MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados)
|
||||
Else
|
||||
Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError)
|
||||
DtDatos = Nothing
|
||||
End If
|
||||
|
||||
ObjBancosIE.Dispose()
|
||||
|
||||
If DtDatos IsNot Nothing Then
|
||||
GvDatos.DataSource = DtDatos
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim Liga As String = String.Empty
|
||||
Select Case Opcion
|
||||
Case "Creditos"
|
||||
Liga = String.Format("<a class='Texto' href='javascript:Ir2(""{0}"");'>{1}</a>", e.Row.DBCampo("CveIE"), e.Row.DBCampo("Folio"))
|
||||
Case "Complementos"
|
||||
Liga = String.Format("<a class='Texto' href='javascript:Ir3(""{0}"");'>{1}</a>", e.Row.DBCampo("CveIE"), e.Row.DBCampo("Folio"))
|
||||
Case Else
|
||||
'Liga = String.Format("<a class='Texto' href='javascript:Ir(""{0}"");'>{1}</a>", e.Row.DBCampo("CveIE"), e.Row.DBCampo("Folio"))
|
||||
Liga = String.Format("<a class='Texto' href='/Bancos/IE.aspx?CveIE={0}');'>{1}</a>", e.Row.DBCampo("CveIE"), e.Row.DBCampo("Folio"))
|
||||
End Select
|
||||
e.Row.FCLiteral("LtlFolio").Text = String.Format("<div>{0}</div>", Liga)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user