public Task RemovePlatformAsync(RailwayPlatformModel platform) { return(SafeExecuteAsync(async() => { await _platformService.RemovePlatformAsync(platform.Id); await RefreshStationsAsync(); })); }
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()); }
public AddPlatformFormViewModel( IRailwayPlatformService platformService, ILogger logger, RailwayPlatformModel platformModel, Action onPlatformAdded = null, IEventAggregator eventAggregator = null) : base(logger, platformModel, eventAggregator) { _platformService = platformService; _onPlatformAdded = onPlatformAdded; }
private void ShowAddPlatformForm(RailwayStationModel station) { var platform = new RailwayPlatformModel() { RailwayStationId = station.Id }; FormViewModel = new AddPlatformFormViewModel(_platformService, _logger, platform, OnFormSubmitted, EventAggregator); IsDialogOpen = true; }
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}"); })); }
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; })); }
private void ShowEditPlatformForm(RailwayPlatformModel platform) { FormViewModel = new EditPlatformFormViewModel(_platformService, _logger, platform, OnFormSubmitted, EventAggregator); IsDialogOpen = true; }