parent
5a9b425178
commit
e8c210f61c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +1,3 @@
|
|||||||
@using VeraxShield.composants
|
@using VeraxShield.composants
|
||||||
@using VeraxShield.composants.modals
|
@using VeraxShield.composants.modals
|
||||||
|
@using VeraxShield.composants.formulaires
|
@ -0,0 +1,6 @@
|
|||||||
|
@page "/utilisateurs/modifier/{pseudo}"
|
||||||
|
|
||||||
|
<h1> Modifier l'utilisateur </h1>
|
||||||
|
|
||||||
|
<FormulaireModification Pseudo="@Pseudo"/>
|
||||||
|
|
@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using VeraxShield.modele.utilisateurs;
|
||||||
|
using VeraxShield.services.UtilisateursDataService;
|
||||||
|
|
||||||
|
namespace VeraxShield.pages.utilisateurs
|
||||||
|
{
|
||||||
|
public partial class ModifierUtilisateur
|
||||||
|
{
|
||||||
|
[Parameter]
|
||||||
|
public String Pseudo {get; set;}
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private IUtilisateursDataService utilisateursDataService {get; set;}
|
||||||
|
|
||||||
|
private Utilisateur utilisateur {get; set;}
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
<EditForm Model="@Modele" OnValidSubmit="@modifierUtilisateur">
|
||||||
|
|
||||||
|
<DataAnnotationsValidator />
|
||||||
|
<Microsoft.AspNetCore.Components.Forms.ValidationSummary />
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="pseudo">
|
||||||
|
Pseudo :
|
||||||
|
<InputText id="pseudo" @bind-Value="Modele.Pseudo" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="prenom">
|
||||||
|
Prénom :
|
||||||
|
<InputText id="prenom" @bind-Value="Modele.Prenom" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="nom">
|
||||||
|
Nom :
|
||||||
|
<InputText id="nom" @bind-Value="Modele.Nom" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="role">
|
||||||
|
Role :
|
||||||
|
<InputText id="role" @bind-Value="Modele.Role" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="mail">
|
||||||
|
Email :
|
||||||
|
<InputText id="mail" @bind-Value="Modele.Mail" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="mdp">
|
||||||
|
Mot de passe :
|
||||||
|
<InputText id="mdp" @bind-Value="Modele.Mdp" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
Utilisateur banni :
|
||||||
|
<InputCheckbox @bind-Value="Modele.IsBan" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<button Type="Submit">Valider la modification </button>
|
||||||
|
|
||||||
|
</EditForm>
|
@ -0,0 +1,45 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using VeraxShield.composants.formulaires.modeles;
|
||||||
|
using VeraxShield.factories;
|
||||||
|
using VeraxShield.modele.utilisateurs;
|
||||||
|
using VeraxShield.services.UtilisateursDataService;
|
||||||
|
|
||||||
|
namespace VeraxShield.composants.formulaires
|
||||||
|
{
|
||||||
|
public partial class FormulaireModification
|
||||||
|
{
|
||||||
|
[Parameter]
|
||||||
|
public String Pseudo { get; set; }
|
||||||
|
public Utilisateur Utilisateur {get; set;}
|
||||||
|
|
||||||
|
public FormulaireAjoutModele Modele {get; set;}
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private IUtilisateursDataService utilisateursDataService { get; set; }
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
Console.WriteLine("[comp] pseudo param : " + this.Pseudo);
|
||||||
|
|
||||||
|
Utilisateur temp = await this.utilisateursDataService.getUtilisateurFromPseudo(this.Pseudo);
|
||||||
|
|
||||||
|
if (temp != null)
|
||||||
|
{
|
||||||
|
Console.WriteLine("[comp] : Le user est pas nul ! p : " + temp.Pseudo);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Utilisateur = new Utilisateur("temp", "temp", "temp", "temp", "temp", "temp", true);
|
||||||
|
|
||||||
|
this.Modele = UtilisateursFactory.toModele(this.Utilisateur);
|
||||||
|
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected async Task modifierUtilisateur()
|
||||||
|
{
|
||||||
|
Utilisateur temp = UtilisateursFactory.toUtilisateur(this.Modele);
|
||||||
|
await this.utilisateursDataService.MettreAJourUtilisateur(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
e5084db0badd53379098814e6b48963b76c16f5bcfb70eb45b38ace6d4ca9ded
|
54388b557ba92b76c307a7afba2e76a1459e8fd062bb8c259cfc947608a2146e
|
||||||
|
Binary file not shown.
@ -1 +1 @@
|
|||||||
93e1c9232111223b05115fd1d9ae73ec628ba0ee89fcc886f90e3413eb2ef36b
|
b6db3d3d769bf7d4e4e9ba5aabf655e09c7239c2b4702b38f5cb1ea5a9587451
|
||||||
|
Binary file not shown.
@ -1 +1 @@
|
|||||||
9361fd1aa03e600c8781627902272cf07a9bded1eb89ac137b5a778553b0e891
|
a5ef9924292fc9d83e22623a89ae80f245a08dda172e8ca4fdd9cef47b726341
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue