public void ShowTopTen(string campus, string nameColumn) { try { using var con = CreateConnection(); int position = 0; var dialogTop = new TablistDialog("Top Ten", new[] { "Position", "Name", $"{nameColumn}" }, "Atrás", "Cerrar"); cmd.CommandText = $"SELECT namePlayer, {campus} FROM players ORDER BY {campus} DESC LIMIT 10;"; using var reader = cmd.ExecuteReader(); while (reader.Read()) { dialogTop.Add(new[] { $"#{++position}", reader.GetString("namePlayer"), reader.GetInt32(campus).ToString() }); } dialogTop.Response += (s, e) => { if (e.DialogButton == DialogButton.Left) { DialogMain.Show(Sender); } }; dialogTop.Show(Sender); } catch (MySqlException e) { Sender.SendErrorMessage(e); } }
public CategoryCommand() { DialogCategory = new MessageDialog(" ", "", "Atrás", "Cerrar"); DialogCategory.Response += (sender, e) => { if (e.DialogButton == DialogButton.Left) { DialogMain.Show(e.Player); } }; }