96 lines
3.7 KiB
VB.net
96 lines
3.7 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports System.Linq
|
|
Imports Extensiones
|
|
|
|
Partial Class OS_PopUpBuscarCuentasEquipos
|
|
Inherits ClsPaginas
|
|
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
CType(Me.Master, BaseMasterPage).EsPopup = True
|
|
CType(Me.Master, BaseMasterPage).PopupWidth = 500
|
|
RegistraScript("$get('tdContenido').style.height='350px'")
|
|
|
|
If Not Request("CveCliente") Is Nothing AndAlso Request("CveCliente").ToEntero > 0 Then
|
|
CargarCuentasEquipos(Request("CveCliente").ToEntero)
|
|
End If
|
|
|
|
If Not Request("EsThickbox") Is Nothing Then
|
|
hdnEsThickbox.Value = Request("EsThickbox")
|
|
Else
|
|
hdnEsThickbox.Value = "N"
|
|
End If
|
|
|
|
If Not Request("ClientIDLink") Is Nothing Then
|
|
hdnClientIDLink.Value = Request("ClientIDLink")
|
|
Else
|
|
hdnClientIDLink.Value = "NoDefinido"
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub CargarCuentasEquipos(CveCliente As Integer)
|
|
Dim ObjCuentasEquipos As New ClsGenerales
|
|
|
|
If ObjCuentasEquipos.GetCuentasEquipos(CveCliente, -1) Then
|
|
GvCuentasEquipos.DataSource = ObjCuentasEquipos.DtResultados
|
|
GvCuentasEquipos.DataBind()
|
|
End If
|
|
OrdenaDatos()
|
|
ObjCuentasEquipos.Dispose()
|
|
End Sub
|
|
|
|
#Region "G V D A T O S"
|
|
Protected Sub GvCuentasEquipos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvCuentasEquipos.RowCommand
|
|
If e.CommandName = "Seleccionar" Then
|
|
Dim CveCuentaEquipo As Integer = e.CommandArgument.ToString.ToEntero
|
|
|
|
RegistraScript("CargaCuentaEquipo(" & CveCuentaEquipo.ToString & ");")
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub GvCuentasEquipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentasEquipos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(150)
|
|
e.Row.Cells(1).Width = Unit.Pixel(150)
|
|
e.Row.Cells(2).Width = Unit.Pixel(100)
|
|
e.Row.Cells(3).Width = Unit.Pixel(100)
|
|
End If
|
|
|
|
' e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
|
e.Row.FCLinkButton("LbIdentificador").Text = e.Row.DBCampo("Identificador").ToString
|
|
e.Row.FCLinkButton("LbTipoCuentaEquipo").Text = e.Row.DBCampo("TipoCuentaEquipo").ToString
|
|
e.Row.FCLinkButton("LbNoSerie").Text = e.Row.DBCampo("NoSerie").ToString
|
|
e.Row.FCLinkButton("LbEstatus").Text = e.Row.DBCampo("Estatus").ToString
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub GvCuentasEquipos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvCuentasEquipos.RowDeleting
|
|
Dim ObjCuentasEquipos As New ClsGenerales
|
|
If ObjCuentasEquipos.RemoveCuentaEquipo(GvCuentasEquipos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
|
Alert("La Cuenta y/o Equipo se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
|
ViewState("DTCuentasEquipos") = ObjCuentasEquipos.DtResultados
|
|
|
|
CargarCuentasEquipos(Request("CveCliente").ToEntero)
|
|
|
|
End If
|
|
ObjCuentasEquipos.Dispose()
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "O R D E N A M I E N T O"
|
|
Private Sub OrdenaDatos()
|
|
If (GvCuentasEquipos.Rows.Count > 0) Then
|
|
GvCuentasEquipos.UseAccessibleHeader = True
|
|
GvCuentasEquipos.HeaderRow.TableSection = TableRowSection.TableHeader
|
|
RegistraScript("OrdenarGV();")
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
End Class
|