public static void StartMenu(HotSpotPanel panel, PathToFile filePath, IEnumerable <HotSpotReports> repList) { Console.Title = "Where WiFi?"; Console.CursorVisible = false; while (true) { ShowMenu(); PickOption(); RunOption(panel, filePath, repList); } }
static void Main(string[] args) { PathToFile filePath = new PathToFile(); var fileWifiGdansk = File.ReadAllLines(filePath.FullFilePath); var fileReportFeb = File.ReadAllLines(filePath.TransferReportFeb); var fileReportMarch = File.ReadAllLines(filePath.TransferReportMarch); HotSpotPanel wifi = new HotSpotPanel(); wifi.OrganizeData(fileWifiGdansk); HotSpotReports feb = new HotSpotReports(); feb.OrganizeReports(fileReportFeb); HotSpotReports march = new HotSpotReports(); march.OrganizeReports(fileReportMarch); var res = feb.MergingTwoLists(feb.listOfReports, march.listOfReports); var lowestHotSpotsUserNumber = res.OrderBy(r => r.CurrentHotSpotUsers); StartMenu(wifi, filePath, lowestHotSpotsUserNumber); Console.ReadLine(); }
private static void RunOption(HotSpotPanel panel, PathToFile filePath, IEnumerable <HotSpotReports> repList) { switch (_activeMenuPosition) { case 0: Console.Clear(); InProgress("NNAJBLIŻSZY HOTSPOT"); break; case 1: Console.Clear(); InProgress("DODAJ HOTSPOT"); try { panel.AddNewHotSpot(filePath.FullFilePath); } catch (Exception m) { Console.WriteLine(m.StackTrace); } break; case 2: Console.Clear(); InProgress("LISTA HOTSPOTÓW"); Console.WriteLine(); panel.ShowAllLocalizations(); break; case 3: Console.Clear(); InProgress("NAJMNIEJ POŁĄCZEŃ"); Console.WriteLine("Podaj liczbę interesujących Cię wyników"); var shortedList = repList.Take(int.Parse(Console.ReadLine())); foreach (var r in shortedList) { Console.WriteLine($"ID: {r.Id}, Miejsce: {r.LocationName}, Średnia dzienna liczba użytkowników to: {r.CurrentHotSpotUsers}", CultureInfo.CurrentUICulture.TextInfo); } Console.ReadKey(); break; case 4: Console.Clear(); InProgress("PODEJRZANIE DUŻE TRANSFERY"); var exitSubMenu = false; do { _activeMenuPosition = 0; ShowMenuOverloadTransfer(); exitSubMenu = PickOptionOverload(); RunOptionOverload(); } while (!exitSubMenu); _activeMenuPosition = 0; break; case 5: Console.Clear(); InProgress("Edycja Twoich punktów HOTSPOT"); panel.EditAddedHotspots(); break; case 6: Console.Clear(); Environment.Exit(0); break; } }