119 lines
5.9 KiB
VB.net
119 lines
5.9 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports Extensiones
|
|
Partial Class Compras_PopUpBuscarProveedor
|
|
Inherits ClsPaginas
|
|
|
|
Private ReadOnly Property OpcionBusqueda As String
|
|
Get
|
|
Return ViewState("Opt").ToString
|
|
End Get
|
|
End Property
|
|
|
|
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 = 780
|
|
RegistraScript("$get('tdContenido').style.height='465px'")
|
|
|
|
Dim Txt As String = IfNull(Request("Txt"), "").ToString
|
|
If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt)
|
|
|
|
Select Case Request("Opt")
|
|
Case "Fact"
|
|
ViewState("Opt") = "Factura"
|
|
Case "OI/OE"
|
|
ViewState("Opt") = "OI/OE"
|
|
Case "Poliza"
|
|
ViewState("Opt") = "Poliza"
|
|
Case Else
|
|
ViewState("Opt") = "Expediente"
|
|
End Select
|
|
|
|
If Not Request("EsThickbox") Is Nothing Then
|
|
hdnEsThickbox.Value = Request("EsThickbox")
|
|
Else
|
|
hdnEsThickbox.Value = "N"
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
|
Dim ObjProveedor As New ClsCompProveedores()
|
|
|
|
Dim Codigo As String = "-1"
|
|
Dim RazonSocial As String = "-1"
|
|
Dim NombreComercial As String = "-1"
|
|
Dim NombreCorto As String = "-1"
|
|
Dim RFC As String = "-1"
|
|
Dim Contacto As String = "-1"
|
|
Dim Telefono As String = "-1"
|
|
Dim CveTipoProveedor As Integer = -1
|
|
|
|
If TxtCodigo.Text.Trim <> String.Empty Then Codigo = TxtCodigo.Text.Trim
|
|
If TxtRazonSocial.Text.Trim <> String.Empty Then RazonSocial = TxtRazonSocial.Text.Trim
|
|
If TxtNombreComercial.Text.Trim <> String.Empty Then NombreComercial = TxtNombreComercial.Text.Trim
|
|
If TxtNombreCorto.Text.Trim <> String.Empty Then NombreCorto = TxtNombreCorto.Text.Trim
|
|
If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim
|
|
If TxtContacto.Text.Trim <> String.Empty Then Contacto = TxtContacto.Text.Trim
|
|
If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim
|
|
CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero
|
|
|
|
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, Codigo, RazonSocial, NombreComercial, NombreCorto, RFC, Contacto, Telefono, -1, UsuarioActual.CveEmpresa, CveTipoProveedor:=CveTipoProveedor) Then
|
|
If ObjProveedor.DtResultados.Rows.Count > 0 Then
|
|
LtlTotalRegistros.Text = ObjProveedor.DtResultados.Rows.Count.ToString.FormatoNumero(0)
|
|
GV.DataSource = ObjProveedor.DtResultados
|
|
Else
|
|
LtlTotalRegistros.Text = "0"
|
|
GV.DataSource = Nothing
|
|
Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
End If
|
|
|
|
ObjProveedor.Dispose()
|
|
GV.DataBind()
|
|
|
|
UPDatos.Update()
|
|
|
|
TblBusqueda.Visible = True
|
|
End Sub
|
|
|
|
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
'e.Row.Cells(0).Width = Unit.Pixel(40)
|
|
'e.Row.Cells(1).Width = Unit.Pixel(200)
|
|
'e.Row.Cells(2).Width = Unit.Pixel(200)
|
|
'e.Row.Cells(3).Width = Unit.Pixel(60)
|
|
'e.Row.Cells(4).Width = Unit.Pixel(60)
|
|
'e.Row.Cells(5).Width = Unit.Pixel(130)
|
|
End If
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Left
|
|
Dim Liga As String = String.Empty
|
|
Select Case OpcionBusqueda
|
|
Case "Factura"
|
|
Liga = String.Format("<a class='Texto' href='javascript:Ir2(""{0}"");'>", e.Row.DBCampo("CveProveedor"))
|
|
Case "OI/OE"
|
|
Liga = String.Format("<a class='Texto' href='javascript:IrOI(""{0}"");'>", e.Row.DBCampo("CveProveedor"))
|
|
Case "Poliza"
|
|
Liga = String.Format("<a class='Texto' href='javascript:IrPoliza(""{0}"");'>", e.Row.DBCampo("CveProveedor"))
|
|
Case Else
|
|
Liga = String.Format("<a class='Texto' href='javascript:Ir(""{0}"");'>", e.Row.DBCampo("CveProveedor"))
|
|
End Select
|
|
|
|
e.Row.FCLiteral("LtlCodigo").Text = String.Format("<div class='truncate' style='width:55px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Codigo"))
|
|
e.Row.FCLiteral("LtlRazonSocial").Text = String.Format("<div class='truncate' style='width:165px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("RazonSocial"))
|
|
e.Row.FCLiteral("LtlNombreComercial").Text = String.Format("<div class='truncate' style='width:165px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("NombreComercial"))
|
|
e.Row.FCLiteral("LtlNombreCorto").Text = String.Format("<div class='truncate' style='width:80px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("NombreCorto"))
|
|
e.Row.FCLiteral("LtlRFC").Text = String.Format("<div class='truncate' style='width:120px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("RFC"))
|
|
e.Row.FCLiteral("LtlContacto").Text = String.Format("<div class='truncate' style='width:65px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("ContactoNombre"))
|
|
End If
|
|
End Sub
|
|
End Class
|