Exemple #1
0
        /// <summary>
        /// Загрузка расписания по http.
        /// Загрузка станций из XML файла.
        /// </summary>
        public async void LoadHttpSheduleAndLoadXmlStationsInDb(string tableName, string railwayStationName, int ecpCode)
        {
            string pathStations = null;

            var fbd = new OpenFileDialog
            {
                Filter = @"XML Files (.xml)|*.xml|All Files (*.*)|*.*",
                Title  = "Файл со станциями"
            };
            var result = fbd.ShowDialog();

            if ((result == DialogResult.OK) && (!string.IsNullOrWhiteSpace(fbd.FileName)))
            {
                pathStations = fbd.FileName;
            }

            if (string.IsNullOrEmpty(pathStations))
            {
                return;
            }


            var stationOwner = new Station {
                Name = railwayStationName, EcpCode = ecpCode
            };

            var processViewModel = new ProcessViewModel(_eventAggregator, stationOwner);

            _windowManager.ShowWindow(processViewModel);

            await ApkDk.LoadHttpSheduleAndLoadXmlStationsInDb(pathStations, tableName, stationOwner);
        }
Exemple #2
0
        /// <summary>
        /// Загрузка расписания и станций по http.
        /// </summary>
        public async void LoadHttpDataInDb(string tableName, string railwayStationName, int ecpCode)
        {
            var stationOwner = new Station {
                Name = railwayStationName, EcpCode = ecpCode
            };

            var processViewModel = new ProcessViewModel(_eventAggregator, stationOwner);

            _windowManager.ShowWindow(processViewModel);

            await ApkDk.LoadHttpDataInDb(tableName, stationOwner);
        }