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 ObjCRM As New ClsCRM() Dim RFC As String = "-1" Dim NombreEmpresa As String = "-1" If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim If TxtNombreEmpresa.Text.Trim <> String.Empty Then NombreEmpresa = TxtNombreEmpresa.Text.Trim If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, -1, NombreEmpresa, RFC) Then If ObjCRM.DtResultados.Rows.Count > 0 Then LtlTotalRegistros.Text = ObjCRM.DtResultados.Rows.Count.ToString.FormatoNumero(0) GV.DataSource = ObjCRM.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 ObjCRM.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 e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM"))) e.Row.FCHyperLink("Hp2").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM"))) e.Row.FCHyperLink("Hp3").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM"))) e.Row.FCHyperLink("Hp4").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM"))) e.Row.FCHyperLink("Hp5").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM"))) e.Row.FCHyperLink("Hp6").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM"))) End If End Sub End Class