Exemplo n.º 1
0
        async Task OnButtonClicked(object sender, EventArgs args, Button butt, competitionCreationSeed seed)
        {
            if (!MeetsCriteria(seed))
            {
                errorLabel.IsVisible = true;
            }
            else
            {
                int type = LiveType.SelectedIndex;
                Assets.Competition comp = new Assets.Competition(0, eventName.Text, startDate.Date, endDate.Date, description.Text, type, Session.Id);
                int compIndex           = MySQLManager.InsertCompetition(comp);

                foreach (var item in seed.Tasks)
                {
                    item.fk_Competition_id = compIndex;
                    MySQLManager.InsertTask(item);
                }

                await Navigation.PushAsync(new HomePage());
            }
        }