private void GenerateStatsLayouts() { if (_conn.GetEncountersByPlayer(_userId).Count == 0) { var label = new Label { Text = "Enter Encounter to See Stats", FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), HorizontalOptions = LayoutOptions.CenterAndExpand }; dynamicSection.Children.Add(label); Grid.SetColumnSpan(label, 2); } else { killStats.Children.Add(CreateStatsLayout(Stats.Kill)); assistStats.Children.Add(CreateStatsLayout(Stats.Assist)); dealtStats.Children.Add(CreateStatsLayout(Stats.Dealt)); takenStats.Children.Add(CreateStatsLayout(Stats.Taken)); healStats.Children.Add(CreateStatsLayout(Stats.Heal)); dropStats.Children.Add(CreateStatsLayout(Stats.Drop)); var button = new Button { Text = "Player Stats", HorizontalOptions = LayoutOptions.StartAndExpand }; button.Clicked += resetButton_Clicked; resetButton.Children.Add(button); } }
private List <Encounter> SearchEncounters(string searchTerm, int userId) { var elist = _conn.GetEncountersByPlayer(userId); var encounters = new List <Encounter>(); if (searchTerm == null || searchTerm == "") { return(elist); } else { foreach (var e in elist) { var name = e.EncounterName.ToLower(); if (name.Contains(searchTerm.ToLower())) { encounters.Add(e); } } } return(encounters); }