This repository has been archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
630 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,72 @@ | ||
Imports MySql.Data | ||
Imports MySql.Data.MySqlClient | ||
|
||
Public Class Accueil | ||
Inherits System.Web.UI.Page | ||
|
||
Private m_connection As MySqlConnection | ||
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | ||
If Session("connected") Is Nothing Then | ||
Session.Add("connected", False) | ||
Session.Timeout = 30 | ||
End If | ||
If Session("idMembre") Is Nothing Then | ||
Session.Add("idMembre", -1) | ||
End If | ||
If Session("Admin") Is Nothing Then | ||
Session.Add("Admin", False) | ||
End If | ||
m_connection = New MySqlConnection(My.Resources.StringConnexionBdd) | ||
m_connection.Open() | ||
NouveauxMembre() | ||
End Sub | ||
|
||
Public Sub NouveauxMembre() | ||
Dim Membres As List(Of Entites.Membre) = Entites.Membre.ListeMembresOrdonnee(m_connection) | ||
Dim Nombre As Integer = Membres.Count | ||
|
||
If (Nombre > 5) Then | ||
Nombre = 5 | ||
End If | ||
|
||
|
||
If Membres IsNot Nothing Then | ||
For value As Integer = 0 To Nombre - 1 | ||
Dim Membre As Entites.Membre = Membres(value) | ||
Dim nouvDiv As New HtmlGenericControl("div") | ||
nouvDiv.Attributes.Add("class", "membre") | ||
|
||
'Image | ||
Dim nouvA As New HtmlGenericControl("a") | ||
nouvA.Attributes.Add("href", "Membreinfo.aspx?pseudo=" + Membre.getNomUtilisateurParId(Membre.id, m_connection)) | ||
Dim nouvImage As New Image() | ||
nouvImage.ID = "img" + Membre.id.ToString | ||
nouvImage.ImageUrl = Membre.Image | ||
nouvImage.Attributes.Add("alt", "imgAvant" + Membre.id.ToString) | ||
nouvA.Controls.Add(nouvImage) | ||
nouvDiv.Controls.Add(nouvA) | ||
|
||
'Nouveau Membre | ||
Dim nouvMembre As New Label | ||
nouvMembre.Attributes.Add("class", "lblMembreAcceuil") | ||
nouvMembre.ID = "lblMembre2" + Membre.id.ToString | ||
'Label avec un balise a, font et 2 balises br dedans pour rediriger vers la page MembreInfo | ||
nouvMembre.Text = "<a href=" & Chr(34) & "Membreinfo.aspx?pseudo=" + Membre.getNomUtilisateurParId(Membre.id, m_connection) & Chr(34) & _ | ||
"STYLE=" & Chr(34) & "TEXT-DECORATION: NONE" & Chr(34) & "><font color=" & Chr(34) & "B8C3B8" & Chr(34) & ">" & _ | ||
Membre.getNomUtilisateurParId(Membre.id, m_connection) + " <br/> <br/></font></a>" | ||
nouvDiv.Controls.Add(nouvMembre) | ||
|
||
'Date d'inscription | ||
Dim nouvDateInscription As New Label() | ||
nouvDateInscription.Attributes.Add("class", "lblDateInscription") | ||
nouvDateInscription.ID = "lblDateInscription" + Membre.id.ToString | ||
nouvDateInscription.Text = "Date d'inscription: " + Membre.DateInscription.Day.ToString + "-" & _ | ||
Membre.DateInscription.Month.ToString + "-" + Membre.DateInscription.Year.ToString | ||
nouvDiv.Controls.Add(nouvDateInscription) | ||
|
||
phNouvMembre.Controls.Add(nouvDiv) | ||
Next | ||
End If | ||
End Sub | ||
Imports MySql.Data | ||
Imports MySql.Data.MySqlClient | ||
|
||
Public Class Accueil | ||
Inherits System.Web.UI.Page | ||
|
||
Private m_connection As MySqlConnection | ||
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | ||
If Session("connected") Is Nothing Then | ||
Session.Add("connected", False) | ||
Session.Timeout = 30 | ||
End If | ||
If Session("idMembre") Is Nothing Then | ||
Session.Add("idMembre", -1) | ||
End If | ||
If Session("Admin") Is Nothing Then | ||
Session.Add("Admin", False) | ||
End If | ||
m_connection = New MySqlConnection(My.Resources.StringConnexionBdd) | ||
m_connection.Open() | ||
NouveauxMembre() | ||
m_connection.Close() | ||
End Sub | ||
|
||
Public Sub NouveauxMembre() | ||
Dim Membres As List(Of Entites.Membre) = Entites.Membre.ListeMembresOrdonnee(m_connection) | ||
Dim Nombre As Integer = Membres.Count | ||
|
||
If (Nombre > 5) Then | ||
Nombre = 5 | ||
End If | ||
|
||
|
||
If Membres IsNot Nothing Then | ||
For value As Integer = 0 To Nombre - 1 | ||
Dim Membre As Entites.Membre = Membres(value) | ||
Dim nouvDiv As New HtmlGenericControl("div") | ||
nouvDiv.Attributes.Add("class", "membre") | ||
|
||
'Image | ||
Dim nouvA As New HtmlGenericControl("a") | ||
nouvA.Attributes.Add("href", "Membreinfo.aspx?pseudo=" + Membre.getNomUtilisateurParId(Membre.id, m_connection)) | ||
Dim nouvImage As New Image() | ||
nouvImage.ID = "img" + Membre.id.ToString | ||
nouvImage.ImageUrl = Membre.Image | ||
nouvImage.Attributes.Add("alt", "imgAvant" + Membre.id.ToString) | ||
nouvA.Controls.Add(nouvImage) | ||
nouvDiv.Controls.Add(nouvA) | ||
|
||
'Nouveau Membre | ||
Dim nouvMembre As New Label | ||
nouvMembre.Attributes.Add("class", "lblMembreAcceuil") | ||
nouvMembre.ID = "lblMembre2" + Membre.id.ToString | ||
'Label avec un balise a, font et 2 balises br dedans pour rediriger vers la page MembreInfo | ||
nouvMembre.Text = "<a href=" & Chr(34) & "Membreinfo.aspx?pseudo=" + Membre.getNomUtilisateurParId(Membre.id, m_connection) & Chr(34) & _ | ||
"STYLE=" & Chr(34) & "TEXT-DECORATION: NONE" & Chr(34) & "><font color=" & Chr(34) & "B8C3B8" & Chr(34) & ">" & _ | ||
Membre.getNomUtilisateurParId(Membre.id, m_connection) + " <br/> <br/></font></a>" | ||
nouvDiv.Controls.Add(nouvMembre) | ||
|
||
'Date d'inscription | ||
Dim nouvDateInscription As New Label() | ||
nouvDateInscription.Attributes.Add("class", "lblDateInscription") | ||
nouvDateInscription.ID = "lblDateInscription" + Membre.id.ToString | ||
nouvDateInscription.Text = "Date d'inscription: " + Membre.DateInscription.Day.ToString + "-" & _ | ||
Membre.DateInscription.Month.ToString + "-" + Membre.DateInscription.Year.ToString | ||
nouvDiv.Controls.Add(nouvDateInscription) | ||
|
||
phNouvMembre.Controls.Add(nouvDiv) | ||
Next | ||
End If | ||
End Sub | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,37 @@ | ||
Public Class Membre | ||
Imports MySql.Data.MySqlClient | ||
|
||
''' <summary> | ||
''' Page maitre pour l'affichage des informations, des cartes d'un membre, et pour l'envoi de messages | ||
''' </summary> | ||
Public Class Membre | ||
Inherits System.Web.UI.MasterPage | ||
|
||
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | ||
Dim connected As Boolean = Boolean.Parse(Session("connected")) | ||
Dim idMembre As Integer = Integer.Parse(Session("idMembre")) | ||
Dim connection As MySqlConnection = New MySqlConnection(My.Resources.StringConnexionBdd) | ||
connection.Open() | ||
Dim pseudoMembre As String = Entites.Membre.getNomUtilisateurParId(idMembre, connection) | ||
connection.Close() | ||
Dim pseudo As String = Request.QueryString("pseudo") | ||
|
||
If IsNothing(pseudo) And Not connected Then | ||
Erreur.afficherErreur(Page) | ||
ElseIf IsNothing(pseudo) And connected Then | ||
ongletGererCollections.Visible = True | ||
ongletVisualiserMessages.Visible = True | ||
ongletEnvoiMessage.Visible = False | ||
Else | ||
ongletInformations.HRef += "?pseudo=" & pseudo | ||
ongletListeCartes.HRef += "?pseudo=" & pseudo | ||
ongletGererCollections.Visible = False | ||
ongletVisualiserMessages.Visible = False | ||
If connected Then | ||
ongletEnvoiMessage.HRef += "?pseudo=" & pseudo | ||
Else | ||
ongletEnvoiMessage.Visible = False | ||
End If | ||
End If | ||
End Sub | ||
|
||
End Class |
Oops, something went wrong.