diff --git a/Sources/Stim/AddGamePage.xaml b/Sources/Stim/AddGamePage.xaml
index 8ceb851..4d1680c 100644
--- a/Sources/Stim/AddGamePage.xaml
+++ b/Sources/Stim/AddGamePage.xaml
@@ -19,10 +19,11 @@
+
-
+
@@ -58,7 +59,8 @@
+
-
+
\ No newline at end of file
diff --git a/Sources/Stim/AddGamePage.xaml.cs b/Sources/Stim/AddGamePage.xaml.cs
index a5c0419..568f718 100644
--- a/Sources/Stim/AddGamePage.xaml.cs
+++ b/Sources/Stim/AddGamePage.xaml.cs
@@ -5,6 +5,7 @@ namespace Stim;
public partial class AddGamePage : ContentPage
{
public Manager Manager { get; set; }
+
public AddGamePage(Manager Mgr)
{
InitializeComponent();
@@ -13,10 +14,10 @@ public partial class AddGamePage : ContentPage
private void AddGame(object sender, EventArgs e)
{
- //faut rajouter des tests
- string tag1 = TagEntry1.Text;
- string tag2 = TagEntry2.Text;
- string tag3 = TagEntry3.Text;
- Manager.AddGametoGamesList(new Game(NameEntry.Text, DescriptionEntry.Text, int.Parse(YearEntry.Text), new List { tag1, tag2, tag3 }, "null", "www.link.com"));
+ int year;
+ if (string.IsNullOrEmpty(NameEntry.Text) || string.IsNullOrEmpty(DescriptionEntry.Text) || string.IsNullOrEmpty(YearEntry.Text) || !int.TryParse(YearEntry.Text, out year) || string.IsNullOrWhiteSpace(LinkEntry.Text)) return;
+
+ Manager.AddGametoGamesList(new Game(NameEntry.Text, DescriptionEntry.Text, year, new List { TagEntry1.Text, TagEntry2.Text, TagEntry3.Text }, "nyancat.png", LinkEntry.Text));
+ Navigation.RemovePage(this);
}
}
\ No newline at end of file