Public Class ucPerfilUsuario
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            gcSemaforo.Value = ValorSemaforo()

            Dim oUsuario As New UsuariosBusinessObject(CInt(Page.User.Identity.Name))
            If oUsuario.Entity.vbClausula = False Or oUsuario.Entity.vbClausula Is Nothing Then
                pcClausula.ShowOnPageLoad = True
            End If
        End If
    End Sub

    Private Function ValorSemaforo() As Integer
        Dim oUsuario As New UsuariosBusinessObject(CInt(Page.User.Identity.Name))
        Dim medidor As Integer = 1
        If Not (oUsuario.Entity.fechanacimiento Is Nothing Or oUsuario.Entity.direccion Is Nothing) Then
            medidor += 1
        End If

        If oUsuario.Entity.vbEspecialidad = True Then
            medidor += 1
        End If

        If oUsuario.Entity.vbReferencias = True Then
            medidor += 1
        End If
        Return (medidor * 100) / 4
    End Function


    Protected Sub gcSemaforo_CustomCallback(sender As Object, e As DevExpress.Web.CallbackEventArgsBase) Handles gcSemaforo.CustomCallback
        gcSemaforo.Value = ValorSemaforo()
    End Sub

    Protected Sub cbpClausula_Callback(sender As Object, e As DevExpress.Web.CallbackEventArgsBase) Handles cbpClausula.Callback
        Dim oUsuario As New UsuariosBusinessObject(CInt(Page.User.Identity.Name))
        oUsuario.Entity.vbClausula = True
        oUsuario.SaveChanges()
    End Sub


End Class