mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-09 19:15:59 +08:00
@@ -84,7 +84,7 @@ namespace CRSim.Core.Services
|
||||
string tel = "";
|
||||
foreach (string station in stations)
|
||||
{
|
||||
if (station == "';") continue;
|
||||
if (station.StartsWith("';")) continue;
|
||||
if (station.Split("|")[1] == name)
|
||||
{
|
||||
tel = station.Split("|")[2];
|
||||
|
||||
@@ -538,17 +538,24 @@ public partial class StationManagementPageViewModel : ObservableObject
|
||||
[RelayCommand]
|
||||
public async Task ImportFromInternet()
|
||||
{
|
||||
if (!CheckCanImport()) return;
|
||||
var stops = await _networkService.GetTrainNumbersAsync(SelectedStation.Name);
|
||||
if (stops.Count != 0)
|
||||
try
|
||||
{
|
||||
TrainStops.Clear();
|
||||
foreach (TrainStop t in stops)
|
||||
if (!CheckCanImport()) return;
|
||||
var stops = await _networkService.GetTrainNumbersAsync(SelectedStation.Name);
|
||||
if (stops.Count != 0)
|
||||
{
|
||||
TrainStops.Add(RandomTrainStopProperties(t));
|
||||
TrainStops.Clear();
|
||||
foreach (TrainStop t in stops)
|
||||
{
|
||||
TrainStops.Add(RandomTrainStopProperties(t));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
else
|
||||
catch
|
||||
{
|
||||
_dialogService.ShowMessage("获取失败", "服务器繁忙或车站不存在。");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user