Public Class ucCambiarCorreo
    Inherits ucBase

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RegisterCustomMessage(cbpCorreo)
        Dim oUsuario As UsuariosBusinessObject = New UsuariosBusinessObject(CInt(Page.User.Identity.Name))
        lblCorreo.Text = oUsuario.Entity.email
    End Sub

    Protected Sub cbpCorreo_Callback(sender As Object, e As DevExpress.Web.CallbackEventArgsBase) Handles cbpCorreo.Callback
        Dim oUsuario As UsuariosBusinessObject = New UsuariosBusinessObject(CInt(Page.User.Identity.Name))
        oUsuario.Entity.email = txtCorreo1.Text

        If oUsuario.SaveChanges().EventType = MSG.MsgType.Errors Then
            CustomMessage("No se pudo cambiar su correo electrónico", "Error", cbpCorreo)
        Else
            CustomMessage("Su correo electrónico ha sido cambiado", "Notificación", cbpCorreo)
        End If
       
    End Sub
End Class