Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
b0e3fcc
remplacement des daos par des classes temporaires
Oct 29, 2023
1f359f6
Connexion
Oct 30, 2023
daaf7e8
Lecture des données depuis l'API
Oct 30, 2023
b041b57
Gestion des catégories
Oct 30, 2023
418831f
Gestion des produits
Oct 30, 2023
185d2ab
Gestion des utilisateurs/adhérents
Oct 31, 2023
a8a1e00
Connexion avec la base de données GalliumV2 pour les statistiques
Oct 31, 2023
efcca38
Paiements avec l'API
Oct 31, 2023
1d23f0f
Remettre en place les contraintes de nom d'utilisateur
Oct 31, 2023
1696e0f
Merge remote-tracking branch 'origin/master' into non
Oct 31, 2023
cb01847
Fix IHM suite au merge
Oct 31, 2023
9c97046
connecté au service gallium + enlevé le nom d'utilisateur/mot de pass…
Nov 4, 2023
7708d61
modification du connectionstring pour le dao des logs
Nov 6, 2023
14ea9e5
Utilisation 2e database pour stats + fix ihm accueil
FlorianMarteau Nov 6, 2023
e379822
Suppression temporaire stats et fix retirer produit de la caisse
FlorianMarteau Nov 6, 2023
14bc6f8
fix meme instance de produits et acompte pour caisse
FlorianMarteau Nov 6, 2023
8ddf008
produits indisponibles cachés par défaut
FlorianMarteau Nov 6, 2023
29d4665
fix stats
FlorianMarteau Nov 7, 2023
4d7f901
retrait code devenu inutile
FlorianMarteau Nov 7, 2023
43c7b84
Fix Stats + click sur stat renvoie sur les details
FlorianMarteau Nov 7, 2023
c49026c
ok
IndorieSama Nov 7, 2023
280b98d
Merge branch 'non' of https://github.com/DamienChabret/GalliumPlus in…
IndorieSama Nov 7, 2023
135639f
affichage nom et prenom
FlorianMarteau Nov 8, 2023
cc869bd
Merge branch 'non' of https://github.com/DamienChabret/GalliumPlus in…
IndorieSama Nov 8, 2023
06fac2a
ajust font
FlorianMarteau Nov 8, 2023
3d6aaee
Merge branch 'non' of https://github.com/DamienChabret/GalliumPlus in…
IndorieSama Nov 8, 2023
8ac5596
ajout popup argent
FlorianMarteau Nov 8, 2023
4b78820
Merge branch 'non' of https://github.com/DamienChabret/GalliumPlus in…
IndorieSama Nov 8, 2023
696b842
Fix responsive nom compte connecté
FlorianMarteau Nov 8, 2023
456989c
ajustement responsive
FlorianMarteau Nov 8, 2023
3e86190
Merge branch 'non' of https://github.com/DamienChabret/GalliumPlus in…
IndorieSama Nov 8, 2023
cf80f53
ouuuuuu
IndorieSama Nov 20, 2023
7773d8e
aaaah
IndorieSama Nov 20, 2023
3cf0f90
Implémentation du DAO des logs avec l'API
Nov 21, 2023
4fe3d8a
Réparé le système de reconnexion
Nov 21, 2023
b238aef
suppression userviewmodel
FlorianMarteau Nov 21, 2023
1550df6
fusion
FlorianMarteau Nov 21, 2023
6e7ab5a
Merge branch 'non' of https://github.com/DamienChabret/GalliumPlus in…
FlorianMarteau Nov 21, 2023
ccf4127
finalisation suppression userviewModel + serveur dev
FlorianMarteau Nov 21, 2023
ba3164d
Modifs rapides
FlorianMarteau Nov 21, 2023
bb5e4e1
Affichage des logs en asynchrone
Nov 21, 2023
9a10d20
fix du filtre par auteur dans les logs
Nov 22, 2023
7f7579b
fix bug stat et log
FlorianMarteau Nov 22, 2023
9911dab
Merge remote-tracking branch 'origin/non' into async-logs
Nov 22, 2023
7829b86
Fix le projet suite au merge (ça compile!!1!!!1!)
Nov 22, 2023
b47085b
Merge pull request #5 from DamienChabrets/async-logs
louisdevie Nov 22, 2023
4467d59
fix bugs
IndorieSama Nov 22, 2023
db16676
nettoyage daos/mappers liés aux acomtpes
Nov 22, 2023
ea89e22
Fix bug quantite update caisse , + modification gestion stat accueil
FlorianMarteau Nov 24, 2023
43b16e3
fix liste logs author
FlorianMarteau Nov 24, 2023
2efb456
debut stats
FlorianMarteau Nov 24, 2023
48e8a1d
ajout
IndorieSama Dec 8, 2023
2aaccc0
avancement stats
FlorianMarteau Jan 16, 2024
5ba94fa
avancement stat semaine ihm
FlorianMarteau Jan 16, 2024
0d6375e
fix
IndorieSama Jan 16, 2024
d13ec88
Merge branch 'non' of https://github.com/DamienChabret/GalliumPlus in…
FlorianMarteau Jan 16, 2024
e578229
finalisation stats
FlorianMarteau Jan 16, 2024
6b080a8
affinement stats
FlorianMarteau Jan 16, 2024
b38ea97
filtre année , mois , semaine
FlorianMarteau Jan 17, 2024
c43e647
ajout contact accueil poru bugs
FlorianMarteau Jan 31, 2024
38c957d
finalisation stat evolution
FlorianMarteau Feb 7, 2024
807108f
debut bot
FlorianMarteau May 24, 2024
7aabceb
edit: Changement bot Discord
Ashzuu May 26, 2024
5df69ee
Add: Restock
Ashzuu May 27, 2024
dc15327
add: Accompte
Ashzuu May 28, 2024
da84533
Little edit
Ashzuu May 29, 2024
2177f50
Merge pull request #7 from galliumplus/discord
Ashzuu May 29, 2024
095d374
feat: ajout de la contrainte du paiement à moins d'1€ par carte
CharletMaxime Apr 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

ConnectionString.txt

# User-specific files
*.rsuser
*.suo
Expand Down Expand Up @@ -365,3 +367,5 @@ FodyWeavers.xsd
.csproj
/Gallium v1/Data/ConnexionDAO.cs
/Gallium v1/Data/InformatioConnexion.cs

.idea
10 changes: 10 additions & 0 deletions Couche IHM/Couche Data/Couche Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
</PropertyGroup>

<ItemGroup>
<None Remove="Dao\ConnectionString.txt" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Dao\ConnectionString.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Discord.Net.Core" Version="3.14.1" />
<PackageReference Include="Discord.Net.WebSocket" Version="3.14.1" />
<PackageReference Include="MySql.Data" Version="8.0.32" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@

namespace Couche_Data.Dao
{

public class UserDAO : IUserDAO
public class AccountDAO : IAccountDao
{

public void CreateCompte(User compte)
public void CreateAdhérent(Account adhérent)
{
//Connection
dbsDAO.Instance.OpenDataBase();

//Requette SQL
string stm = $"INSERT INTO users VALUES (0,'{compte.Prenom}','{compte.Nom}','{compte.Mail}','{compte.HashedPassword}',{compte.IdRole})";
string stm = $"INSERT INTO User VALUES (0,'{adhérent.Identifiant}','{adhérent.Prenom}','{adhérent.Nom}','{adhérent.Mail}',{adhérent.RoleId},'{adhérent.Formation}',{adhérent.Argent},{adhérent.IsMember},' ',' ','2030-11-25 00:00:00')";
MySqlCommand cmd = new MySqlCommand(stm, dbsDAO.Instance.Sql);
cmd.Prepare();

Expand All @@ -24,87 +23,94 @@ public void CreateCompte(User compte)
using (MySqlCommand selectCommand = new MySqlCommand("SELECT LAST_INSERT_ID() AS nouvel_id", dbsDAO.Instance.Sql))
{
int nouvelId = Convert.ToInt32(selectCommand.ExecuteScalar());
compte.ID = nouvelId;

adhérent.Id = nouvelId;
}

dbsDAO.Instance.CloseDatabase();
}

public List<User> GetComptes()

public List<Account> GetAdhérents()
{
//Connection
dbsDAO.Instance.OpenDataBase();

//Requette SQL
string stm = "SELECT * FROM users ORDER BY firstname";
string stm = "SELECT * FROM User ORDER BY userId";
MySqlCommand cmd = new MySqlCommand(stm, dbsDAO.Instance.Sql);
cmd.Prepare();

//lecture de la requette
MySqlDataReader rdr = cmd.ExecuteReader();
List<User> users = new List<User>();

List<Account> acomptes = new List<Account>();
while (rdr.Read())
{
users.Add(new User(rdr.GetInt32("user_id"), rdr.GetString("lastname"), rdr.GetString("firstname"), rdr.GetString("email"), rdr.GetString("password"), rdr.GetInt16("grade_id")));
acomptes.Add(new Account(rdr.GetInt32("id"), rdr.GetString("userId"), rdr.GetString("lastName"), rdr.GetString("firstName"), rdr.GetString("email"), rdr.GetFloat("deposit"),rdr.GetString("year"),rdr.GetBoolean("isMember"), rdr.GetInt16("role")));
}


rdr.Close();
dbsDAO.Instance.CloseDatabase();
return users;
return acomptes;
}

public List<Role> GetRoles()
{
//Connection
dbsDAO.Instance.OpenDataBase();

//Requette SQL
string stm2 = "SELECT * FROM grades";
MySqlCommand cmd2 = new MySqlCommand(stm2, dbsDAO.Instance.Sql);
cmd2.Prepare();
string stm = "SELECT * FROM Role";
MySqlCommand cmd = new MySqlCommand(stm, dbsDAO.Instance.Sql);
cmd.Prepare();

//lecture de la requette
MySqlDataReader rdr2 = cmd2.ExecuteReader();
MySqlDataReader rdr = cmd.ExecuteReader();

List<Role> roles = new List<Role>();
while (rdr2.Read())
while (rdr.Read())
{
roles.Add(new Role(rdr2.GetInt32("grade_id"), rdr2.GetString("name")));
roles.Add(new Role(rdr.GetInt32("id"), rdr.GetString("name")));
}
rdr2.Close();

rdr.Close();
dbsDAO.Instance.CloseDatabase();
return roles;
}

public void RemoveCompte(User compte)
public void RemoveAdhérent(Account adhérent)
{
//Connection
dbsDAO.Instance.OpenDataBase();

//Requette SQL
string stm = $"DELETE FROM users WHERE user_id = {compte.ID}";
string stm = $"DELETE FROM User WHERE id = {adhérent.Id}";
MySqlCommand cmd = new MySqlCommand(stm, dbsDAO.Instance.Sql);
cmd.Prepare();

//lecture de la requette
cmd.ExecuteNonQuery();

dbsDAO.Instance.CloseDatabase();
}


public void UpdateCompte(User compte)
public void UpdateAdhérent(Account adhérent)
{
//Connection
dbsDAO.Instance.OpenDataBase();

//Requette SQL
string stm = $"UPDATE users SET firstname = '{compte.Prenom}',lastname = '{compte.Nom}',email = '{compte.Mail}',password = '{compte.HashedPassword}',grade_id = {compte.IdRole} WHERE user_id = {compte.ID}";

string formattedAmountMoney = adhérent.Argent.ToString(System.Globalization.CultureInfo.InvariantCulture);
string stm = $"UPDATE User set lastName = '{adhérent.Nom}', firstName = '{adhérent.Prenom}', deposit = {formattedAmountMoney}, isMember = {adhérent.IsMember}, role = {adhérent.RoleId} , email = '{adhérent.Mail}' ,year = '{adhérent.Formation}',password = '{adhérent.HashedPassword}', userId = '{adhérent.Identifiant}' WHERE id = {adhérent.Id}";
MySqlCommand cmd = new MySqlCommand(stm, dbsDAO.Instance.Sql);
cmd.Prepare();


//lecture de la requette
cmd.ExecuteNonQuery();

dbsDAO.Instance.CloseDatabase();
}


}
}

}
91 changes: 0 additions & 91 deletions Couche IHM/Couche Data/Dao/AcompteDAO.cs

This file was deleted.

68 changes: 68 additions & 0 deletions Couche IHM/Couche Data/Dao/CachedLogReader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
using Couche_Data.Interfaces;
using Modeles;
using System.Threading.Tasks.Dataflow;

namespace Couche_Data.Dao
{
public class CachedLogReader : IPaginatedLogReader
{
private List<Log> allLogs;
private BufferBlock<Log> buffer;
private int pageSize;
private int pageIndex;
private bool exhausted;
private object loadLock;

public CachedLogReader(int pageSize, List<Log> allLogs)
{
this.allLogs = allLogs;
buffer = new BufferBlock<Log>();
this.pageSize = pageSize;
pageIndex = 0;
exhausted = false;
loadLock = new object();
}

public int PageSize => pageSize;

public IAsyncEnumerable<Log> GetAsyncStream(CancellationToken ct = default) => buffer.ReceiveAllAsync(ct);

public void LoadNextPage()
{
lock (loadLock)
{
if (!exhausted)
{
int pageStart = pageIndex * pageSize;
int pageEnd = pageStart + pageSize;

if (pageEnd > allLogs.Count)
{
pageEnd = allLogs.Count;
exhausted = true;
}
else
{
pageIndex++;
}

for (int i = pageStart; i < pageEnd; i++)
{
buffer.Post(allLogs[i]);
}
}
}
}

public void Reset()
{
// désactiver l'ancien tampon et en créer un nouveau
buffer.Complete();
buffer = new BufferBlock<Log>();

// remettre le curseur au début
pageIndex = 0;
exhausted = false;
}
}
}
Loading