Imports DevExpress.Web

Public Class ucUsuReferenciasLaborales
    Inherits ucBase
    Public Property TipoReferencia() As Boolean

    ''Public Property tipoReferencia() As Boolean
    ''    Get
    ''        Return CustomSession("tipoReferencia")
    ''    End Get
    ''    Set(ByVal value As Boolean)
    ''        CustomSession("tipoReferencia") = value
    ''    End Set
    ''End Property

    'Public Property Command() As String
    '    Get
    '        Return CustomSession("command")
    '    End Get
    '    Set(ByVal value As String)
    '        CustomSession("command") = value
    '    End Set
    'End Property


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            ObjectUsu_Referencias.SelectParameters("idUsuario").DefaultValue = CInt(Page.User.Identity.Name)
            'RegisterCustomMessage(gridUsuReferencias)

        End If
    End Sub

    ''Public Sub LoadData(idCarga As Integer)
    ''    Me.tipoReferencia = tipoReferencia
    ''    Command = "LoadData"
    ''    EstructuraEstandarASPxGridView.DataBind()
    ''End Sub


    'Private Sub EstructuraEstandarObjectDataSource_Selecting(sender As Object, e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ObjectUsu_Referencias.Selecting
    '    Select Case Command()
    '        'Case "Clean"
    '        '    Me.tipoReferencia = 0
    '        '    e.InputParameters("idCarga") = 0
    '        Case "LoadData"
    '            e.InputParameters("tipoReferencia") = TipoReferencia
    '            'Case "LoadDataByIdCarga_idMetodoComparacionHistorico"
    '            '    EstructuraEstandarObjectDataSource.SelectMethod = "ExecuteSP_BuscarCoincidencia"
    '            '    EstructuraEstandarObjectDataSource.SelectParameters.Clear()
    '            '    CrearParametro("idCarga", TypeCode.Int32, idCarga)
    '            '    CrearParametro("idMetodoComparacionHistorico", TypeCode.Int32, idMetodoComparacionHistorico)
    '            '    e.InputParameters("idCarga") = idCarga
    '            '    e.InputParameters("idMetodoComparacionHistorico") = idMetodoComparacionHistorico
    '        Case Else
    '            ' Carga de data por default
    '            e.InputParameters("tipoReferencia") = TipoReferencia
    '    End Select
    'End Sub


    Protected Sub gridUsuReferencias_RowInserting(sender As Object, e As DevExpress.Web.Data.ASPxDataInsertingEventArgs) Handles gridUsuReferencias1.RowInserting
        e.NewValues("idUsuario") = CInt(Page.User.Identity.Name)
        e.NewValues("tipoReferencia") = True
    End Sub

    Protected Sub gridUsuReferencias_RowUpdating(sender As Object, e As DevExpress.Web.Data.ASPxDataUpdatingEventArgs) Handles gridUsuReferencias1.RowUpdating
        e.NewValues("idReferencia") = (CType(sender, ASPxGridView)).GetRowValuesByKeyValue(e.Keys(0), New String() {"idReferencia"})
    End Sub
End Class