Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

CreateTaxiList.cs 1.8 KiB

vor 8 Monaten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Example.Connectors;
  2. using Example.Models;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace Example.Helpers
  10. {
  11. public class CreateTaxiList
  12. {
  13. public static Dictionary<string, TaxiDataModule> _TaxiList = new Dictionary<string, TaxiDataModule>();
  14. //Get Total Pages from the packs and Loop into them to create a Category List With Packs information in the model CategoryPacksList
  15. public static async Task GetTaxiList()
  16. {
  17. try
  18. {
  19. List<TaxiDataModule> listTaxis = await GetTaxis.LoadTaxis(GetLogedInServer._currentServerLoggedOn.serverID);
  20. if (listTaxis == null)
  21. {
  22. throw new NullReferenceException("Can't load taxi List");
  23. }
  24. else
  25. {
  26. foreach (TaxiDataModule taxi in listTaxis)
  27. {
  28. if (taxi.enabled == true)
  29. {
  30. var dictaxis = new TaxiDataModule();
  31. dictaxis.id = taxi.id;
  32. dictaxis.locationName = taxi.locationName;
  33. dictaxis.discordRoles = taxi.discordRoles;
  34. dictaxis.locationPrice = taxi.locationPrice;
  35. dictaxis.enabled = taxi.enabled;
  36. _TaxiList.Add(taxi.locationName, dictaxis);
  37. }
  38. else { }
  39. }
  40. }
  41. }
  42. catch (Exception ex)
  43. {
  44. Debug.WriteLine(ex.Source + ex.Message + ex.Data + ex.StackTrace);
  45. }
  46. }
  47. }
  48. }