correction de bug sur la page myLibrary

master
enzoj 2 years ago
parent 5cd8163047
commit fb48e7e119

Binary file not shown.

Binary file not shown.

@ -12,7 +12,14 @@ public partial class Livre : ContentView
public static readonly BindableProperty ImageCompProperty = BindableProperty.Create(nameof(ImageComp), typeof(string), typeof(Livre), string.Empty);
public static readonly BindableProperty AuteurCompProperty = BindableProperty.Create(nameof(AuteurComp), typeof(string), typeof(string),null);
public static readonly BindableProperty UserRatingCompProperty = BindableProperty.Create(nameof(UserRatingComp), typeof(float), typeof(Livre), null);
//public static readonly BindableProperty StatutCompProperty = BindableProperty.Create(nameof(StatusComp),typeof(Status), typeof(Livre), null);
/*
public Status StatusComp
{
get => (Status)GetValue(Livre.StatutCompProperty);
set => SetValue(Livre.StatutCompProperty, value);
}*/
public string TitreComp
@ -67,6 +74,7 @@ public partial class Livre : ContentView
ImageXAML.SetBinding(Image.SourceProperty, new Binding(nameof(ImageComp), source: this));
AuteurXAML.SetBinding(Label.TextProperty, new Binding(nameof(AuteurComp), source: this));
NoteXAML.SetBinding(Label.TextProperty, new Binding(nameof (UserRatingComp), source: this));
//StatutXAML.SetBinding (Label.TextProperty, new Binding(nameof(StatusComp), source: this));
}

File diff suppressed because one or more lines are too long

@ -23,7 +23,6 @@ namespace Wrapper
// Liste de books
public ObservableCollection<Book> Books = new ObservableCollection<Book>();
public ObservableCollection<GroupBooks> GroupBooks { get; private set; } = new ObservableCollection<GroupBooks>();

@ -19,13 +19,29 @@ namespace Wrapper
private void LoadDataFonction()
{
var result = UserLibraryManager.GetBooksFromCollection(0,0);
var result = UserLibraryManager.GetBooksFromCollection(0,(int)UserLibraryManager.GetBooksFromCollection(0,0).Result.Item1);
// Books
nbBooks = result.Result.Item1.ToString();
long nb = result.Result.Item1;
if (nb == 0 )
{
nbBooks = " ";
}
else
{
nbBooks = nb.ToString();
}
// Loan
nbLoans = UserLibraryManager.GetPastLoans(0, 0).Result.Item1.ToString();
nb = UserLibraryManager.GetPastLoans(0, 0).Result.Item1;
if (nb == 0)
{
nbLoans = " ";
}
else
{
nbLoans = nb.ToString();
}
// ToBeRead
int compteur = 0;
@ -36,7 +52,14 @@ namespace Wrapper
compteur++;
}
}
if ( compteur == 0 )
{
nbToBeRead = " ";
}
else
{
nbToBeRead = compteur.ToString();
}
// Favorite
nbFavorite = UserLibraryManager.GetFavoritesBooks(0, 0).Result.Item1.ToString();

Loading…
Cancel
Save