private void RemoveLeader_Click(object sender, RoutedEventArgs e) { SelectLeaderDialog selectLeaderDialog = new SelectLeaderDialog(chatBot.gymBotCommand.gymLeaders, "DELETE GYM LEADER"); if (selectLeaderDialog.ShowDialog() == true) { chatBot.gymBotCommand.RemoveLeader(selectLeaderDialog.SelectedLeader); } }
private void UpdateLeaderMenu_Click(object sender, RoutedEventArgs e) { SelectLeaderDialog selectLeaderDialog = new SelectLeaderDialog(chatBot.gymBotCommand.gymLeaders, "Modify gym information for"); if (selectLeaderDialog.ShowDialog() == true) { var leader = from l in chatBot.gymBotCommand.gymLeaders where l.Name.ToLower() == selectLeaderDialog.SelectedLeader.ToLower() select l; AddUpdateDialog dialog = new AddUpdateDialog(leader.FirstOrDefault()); if (dialog.ShowDialog() == true) { chatBot.gymBotCommand.AddOrUpdateLeader(dialog.leader); } } }