Пример #1
0
 public Task RemovePlatformAsync(RailwayPlatformModel platform)
 {
     return(SafeExecuteAsync(async() =>
     {
         await _platformService.RemovePlatformAsync(platform.Id);
         await RefreshStationsAsync();
     }));
 }
Пример #2
0
        protected PlatformFormViewModelBase(ILogger logger, RailwayPlatformModel platform, IEventAggregator eventAggregator = null) : base(logger, eventAggregator)
        {
            InitEntranceTypes();

            RailwayPlatformModel = platform.Clone() as RailwayPlatformModel;
            RailwayPlatformModel.ErrorsChanged += RailwayPlatformModel_ErrorsChanged;

            SubmitCommand = new DelegateCommand(async() => await OnSubmitAsync());
        }
Пример #3
0
 public AddPlatformFormViewModel(
     IRailwayPlatformService platformService,
     ILogger logger,
     RailwayPlatformModel platformModel,
     Action onPlatformAdded           = null,
     IEventAggregator eventAggregator = null) : base(logger, platformModel, eventAggregator)
 {
     _platformService = platformService;
     _onPlatformAdded = onPlatformAdded;
 }
Пример #4
0
        private void ShowAddPlatformForm(RailwayStationModel station)
        {
            var platform = new RailwayPlatformModel()
            {
                RailwayStationId = station.Id
            };

            FormViewModel = new AddPlatformFormViewModel(_platformService, _logger, platform, OnFormSubmitted, EventAggregator);
            IsDialogOpen  = true;
        }
Пример #5
0
 public Task UpdatePlatformAsync(RailwayPlatformModel station)
 {
     return(Task.Run(() =>
     {
         var proxy = GetProxy();
         var dto = _mapper.Map <Common.RailwayPlatformDto>(station);
         proxy.Update(station.Id, dto);
         _logger.Info($"Updated platform {station.Id}");
     }));
 }
Пример #6
0
 public Task <int> AddPlatformAsync(RailwayPlatformModel platform)
 {
     return(Task.Run(() =>
     {
         var dto = _mapper.Map <Common.RailwayPlatformDto>(platform);
         var proxy = GetProxy();
         int id = proxy.Add(dto);
         _logger.Info($"Added platform {id}");
         return id;
     }));
 }
Пример #7
0
 private void ShowEditPlatformForm(RailwayPlatformModel platform)
 {
     FormViewModel = new EditPlatformFormViewModel(_platformService, _logger, platform, OnFormSubmitted, EventAggregator);
     IsDialogOpen  = true;
 }