(Rebase) Resolution de merge conflit entre dev et j3/feat/pagination

This commit is contained in:
Loic Masi
2026-04-04 20:11:20 +02:00
29 changed files with 260 additions and 92 deletions

View File

@@ -114,13 +114,35 @@ public class TitreController : Controller
[HttpPost]
public IActionResult Create(TitreAdminDTO model)
{
if (this.ModelState.IsValid)
if (!this.ModelState.IsValid)
{
this.titreAdminService.CreerTitre(model);
return this.RedirectToAction("Index");
var form = new AdminTitreForm
{
IdArtiste = model.IdArtiste,
Libelle = model.Libelle,
Album = model.Album,
Chronique = model.Chronique,
DateSortie = model.DateSortie,
Duree = model.Duree,
UrlJaquette = model.UrlJaquette,
UrlEcoute = model.UrlEcoute,
Styles = model.Styles,
Artistes = this.artisteRepository.FindAll().Select(a => new SelectListItem
{
Value = a.IdArtiste.ToString(),
Text = a.Nom,
}).ToList(),
AllStyles = this.styleRepository.FindAll().Select(s => new SelectListItem
{
Value = s.IdStyle.ToString(),
Text = s.Libelle,
}).ToList(),
};
return this.View(form);
}
return this.View(model);
this.titreAdminService.CreerTitre(model);
return this.RedirectToAction("Index");
}
/// <summary>
@@ -171,13 +193,36 @@ public class TitreController : Controller
[HttpPost]
public IActionResult Edit(TitreAdminDTO model)
{
if (this.ModelState.IsValid)
if (!this.ModelState.IsValid)
{
this.titreAdminService.ModifierTitre(model);
return this.RedirectToAction("Index");
var form = new AdminTitreForm
{
Id = model.Id,
IdArtiste = model.IdArtiste,
Libelle = model.Libelle,
Album = model.Album,
Chronique = model.Chronique,
DateSortie = model.DateSortie,
Duree = model.Duree,
UrlJaquette = model.UrlJaquette,
UrlEcoute = model.UrlEcoute,
Styles = model.Styles,
Artistes = this.artisteRepository.FindAll().Select(a => new SelectListItem
{
Value = a.IdArtiste.ToString(),
Text = a.Nom,
}).ToList(),
AllStyles = this.styleRepository.FindAll().Select(s => new SelectListItem
{
Value = s.IdStyle.ToString(),
Text = s.Libelle,
}).ToList(),
};
return this.View(form);
}
return this.View(model);
this.titreAdminService.ModifierTitre(model);
return this.RedirectToAction("Index");
}
/// <summary>