public void MergeMatchRecords() { foreach (RecordedMatch record in Records) { Merging.AdjustTeamInfo(Event, record); } Match merged = Merging.Merge(Event, Records[0], Records[1], Records[2], Records[3], Records[4], Records[5]); int index = Event.Matches.FindIndex((m) => m.Number == merged.Number); if (index != -1) { Event.Matches[index] = merged; } else { Event.Matches.Add(merged); } ScoutingJson.SaveEvent(Event, SavePath + Event.EventName + ScoutingJson.EventExtension); ArchiveRecords(merged.Number); Records = new RecordedMatch[6]; OnPropertyChanged("CanMerge"); }
public void NewEvent() { NewEventDialog ned = new NewEventDialog(EventPath); bool? res = ned.ShowDialog(); if (res == true) // Nullable<bool> { MessageBoxResult mbr = MessageBox.Show( "Do you want to save this event before creating a new one?", "Save Event", MessageBoxButton.YesNoCancel); if (mbr == MessageBoxResult.Yes) { SaveAll(); } else if (mbr == MessageBoxResult.Cancel) { return; } FrcEvent frc = new FrcEvent(ned.EventName); Event = frc; ScoutingJson.SaveEvent(Event, ned.Path); EventPath = ned.Path; if (teamsList != null) { Event.PostJsonLoading(teamsList); } } }
public void SaveAll() { if (Event == null) { return; } ScoutingJson.SaveEvent(Event, EventPath); }
public void UpdateTeamsAndEvent(string path) { if (Event.AllTeams != null) { ScoutingJson.SaveTeamsList(Event.AllTeams, path + "Teams" + ScoutingJson.TeamsListExtension); } ScoutingJson.SaveEvent(Event, path + Event.EventName + ScoutingJson.EventExtension); }