Files
SIG/Prospectos/PopUpBuscarProspectos.aspx.vb
JORGE LUIS CAUDILLO ESPARZA c35cf91883 Commit inicial Ventas Productivo
2019-08-14 16:40:54 -07:00

83 lines
3.5 KiB
VB.net

Option Explicit On
Option Strict On
Imports Extensiones
Partial Class PopUpBuscarProspectos
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 = 800
RegistraScript("$get('tdContenido').style.height='520px'")
TxtNombre.Focus()
ViewState("Opt") = IfNull(Request("Opt"), "")
If OpcionBusqueda = "SIP" Then BtnNuevo.Visible = True
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 ObjProsp As New ClsProspectos()
Dim Nombre As String = "-1"
Dim NombreEmpresa As String = "-1"
Dim Celular As String = "-1"
If TxtNombre.Text.Trim <> String.Empty Then Nombre = TxtNombre.Text.Trim
If TxtNombreEmpresa.Text.Trim <> String.Empty Then NombreEmpresa = TxtNombreEmpresa.Text.Trim
If txtCelular.Text.Trim <> String.Empty Then Celular = txtCelular.Text.Trim
If ObjProsp.GetProspectosDetalle(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, Nombre, NombreEmpresa, Celular, UsuarioActual.CveEmpresa) Then
If ObjProsp.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjProsp.DtResultados.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = ObjProsp.DtResultados
Else
LtlTotalRegistros.Text = "0"
GV.DataSource = Nothing
Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If
End If
ObjProsp.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(250)
'e.Row.Cells(1).Width = Unit.Pixel(80)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
Select Case OpcionBusqueda
Case "Redes"
e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospectos/ProspectosRedes.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
Case "Atn"
e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospectos/ProspectosG15.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
Case "SIP"
e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospectos/ProspectosSIP.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
Case Else
e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospectos/Prospectos.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
End Select
End If
End Sub
End Class