|
|
@ -5,6 +5,7 @@ namespace Stim;
|
|
|
|
public partial class AddGamePage : ContentPage
|
|
|
|
public partial class AddGamePage : ContentPage
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public Manager Manager { get; set; }
|
|
|
|
public Manager Manager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public AddGamePage(Manager Mgr)
|
|
|
|
public AddGamePage(Manager Mgr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
@ -13,10 +14,10 @@ public partial class AddGamePage : ContentPage
|
|
|
|
|
|
|
|
|
|
|
|
private void AddGame(object sender, EventArgs e)
|
|
|
|
private void AddGame(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//faut rajouter des tests
|
|
|
|
int year;
|
|
|
|
string tag1 = TagEntry1.Text;
|
|
|
|
if (string.IsNullOrEmpty(NameEntry.Text) || string.IsNullOrEmpty(DescriptionEntry.Text) || string.IsNullOrEmpty(YearEntry.Text) || !int.TryParse(YearEntry.Text, out year) || string.IsNullOrWhiteSpace(LinkEntry.Text)) return;
|
|
|
|
string tag2 = TagEntry2.Text;
|
|
|
|
|
|
|
|
string tag3 = TagEntry3.Text;
|
|
|
|
Manager.AddGametoGamesList(new Game(NameEntry.Text, DescriptionEntry.Text, year, new List<string> { TagEntry1.Text, TagEntry2.Text, TagEntry3.Text }, "nyancat.png", LinkEntry.Text));
|
|
|
|
Manager.AddGametoGamesList(new Game(NameEntry.Text, DescriptionEntry.Text, int.Parse(YearEntry.Text), new List<string> { tag1, tag2, tag3 }, "null", "www.link.com"));
|
|
|
|
Navigation.RemovePage(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|