private void Add_Clicked(object sender, EventArgs e) { if (!HideSeries.IsVisible) { if (String.IsNullOrEmpty(Title.Text)) { DisplayAlert("Empty field", "Please enter a title", "OK"); } else if (String.IsNullOrEmpty(Year.Text)) { DisplayAlert("Empty field", "Please enter a year", "OK"); } else { databaseManager.AddMovie(Title.Text, Description.Text, int.Parse(Year.Text)); } } if (HideSeries.IsVisible) { if (String.IsNullOrEmpty(Title.Text)) { DisplayAlert("Empty field", "Please enter a title", "OK"); } else if (String.IsNullOrEmpty(Year.Text)) { DisplayAlert("Empty field", "Please enter a year", "OK"); } else if (String.IsNullOrEmpty(YearEnded.Text)) { YearEnded.Text = "-1"; } else if (String.IsNullOrEmpty(NumberOfEpisodes.Text)) { DisplayAlert("Empty field", "Please enter the number of episodes", "OK"); } else if (String.IsNullOrEmpty(NumberOfSeasons.Text)) { DisplayAlert("Empty field", "Please enter the number of seasons", "OK"); } else { databaseManager.AddSerie(Title.Text, Description.Text, int.Parse(Year.Text), int.Parse(YearEnded.Text), int.Parse(NumberOfEpisodes.Text), int.Parse(NumberOfSeasons.Text)); } } }