Update (Front-End): Model
continuous-integration/drone/push Build is passing Details

pull/2/head
Louis DUFOUR 2 years ago
parent bc5d494448
commit bfd1789eb6

@ -87,6 +87,9 @@
<MauiXaml Update="Pages\DetailBook.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Pages\Filtrage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>
</Project>

@ -5,15 +5,41 @@ namespace BookApp.Data
{
public class Stub
{
public Book CreateBook(string name, string image, string auteur, bool read, int rating)
public Book CreateBook(
string name,
string image,
Auteur auteur,
StatutDeLecture statut,
int rating,
bool favori = false,
bool next = false,
bool pret = false,
string maisonEdit = "",
string resumer = "",
int nbPage = 0,
string langue = "",
string isbn = "",
string dateAjout = "",
string link = ""
)
{
Book book = new Book
{
Name = name,
ImageBook = image,
Auteur = auteur,
Statut = statut,
Note = new Star(rating),
Read = read
Favori = favori,
Next = next,
Pret = pret,
MaisonEdit = maisonEdit,
Resumer = resumer,
NbPage = nbPage,
Langue = langue,
ISBN = isbn,
dateAjout = dateAjout,
Link = link
};
return book;
@ -25,37 +51,37 @@ namespace BookApp.Data
{
CreateBook(
"La horde du contrevent",
"./Reources/Images/dotnet_bot.svg",
"Alain Damasio",
false,
"./Resources/Images/dotnet_bot.svg",
new Auteur { Id = 1, Name = "Alain Damasio" },
StatutDeLecture.Non_Lu,
4
),
CreateBook(
"La zone du dehors",
"./Reources/Images/dotnet_bot.svg",
"Alain Damasio",
true,
"./Resources/Images/dotnet_bot.svg",
new Auteur { Id = 2, Name = "Alain Damasio" },
StatutDeLecture.Lu,
5
),
CreateBook(
"L'équateur d'Einstein",
"./Reources/Images/dotnet_bot.svg",
"Cixin Liu",
true,
"./Resources/Images/dotnet_bot.svg",
new Auteur { Id = 3, Name = "Cixin Liu" },
StatutDeLecture.Lu,
3
),
CreateBook(
"La forêt Sombe",
"./Reources/Images/dotnet_bot.svg",
"Cixin Liu",
true,
"./Resources/Images/dotnet_bot.svg",
new Auteur { Id = 4, Name = "Cixin Liu" },
StatutDeLecture.Lu,
4
),
CreateBook(
"Le problème à trois corps",
"./Reources/Images/dotnet_bot.svg",
"Cixin Liu",
true,
"./Resources/Images/dotnet_bot.svg",
new Auteur { Id = 5, Name = "Cixin Liu" },
StatutDeLecture.Lu,
5
)
};

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookApp.Model
{
public class Auteur
{
public int Id { get; set; }
public string Name { get; set; }
public Auteur() { }
}
}

@ -11,8 +11,19 @@ namespace BookApp.Model
{
public string Name { get; set; }
public string ImageBook { get; set; }
public string Auteur { get; set; }
public Auteur Auteur { get; set; }
public Star Note { get; set; }
public bool Read { get; set; }
public StatutDeLecture Statut { get; set; }
public bool Favori { get; set; }
public bool Next { get; set; }
public bool Pret { get; set; }
public string MaisonEdit { get; set; }
public string Resumer { get; set; }
public int NbPage { get; set; }
public string Langue { get; set; }
public string ISBN { get; set; }
public string dateAjout { get; set; }
public string Link { get; set; }
}
}

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookApp.Model
{
public class Person
{
public int Id { get; set; }
public string Name { get; set; }
}
}

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookApp.Model
{
public enum StatutDeLecture
{
Lu,
A_Lire,
Non_Lu
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="BookApp.Pages.Filtrage"
Title="Filtrage">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

@ -0,0 +1,9 @@
namespace BookApp.Pages;
public partial class Filtrage : ContentPage
{
public Filtrage()
{
InitializeComponent();
}
}

@ -44,7 +44,7 @@
<!-- Arrière-plan avec BoxView -->
<BoxView Color="LightGray" />
<!-- Label par-dessus le BoxView -->
<Label Text="{Binding Auteur}"
<Label Text="{Binding Auteur.Name}"
Padding="5"
Margin="15,0,0,0"
TextColor="Black" />
@ -66,11 +66,11 @@
<Label Text="{Binding Name}"
TextColor="Black"/>
<Label Text="{Binding Auteur}"
<Label Text="{Binding Auteur.Name}"
TextColor="Black"/>
<Label
Text="{Binding Read}"
Text="{Binding Statut}"
FontAttributes="Bold"/>
<Grid>
<Grid.RowDefinitions>

Loading…
Cancel
Save