Beispiel #1
0
		void OnEdit()
		{
			var tariffDetailsViewModel = new TariffDetailsViewModel(SelectedTariff.Tariff);
			if (DialogService.ShowModalWindow(tariffDetailsViewModel))
			{
				DbCache.UpdateTariff(tariffDetailsViewModel.Tariff);
				DbCache.AddJournalForUser(JournalType.EditTariff, SelectedTariff.Tariff);
				SelectedTariff.Tariff = tariffDetailsViewModel.Tariff;
			}
		}
Beispiel #2
0
		void OnAdd()
		{
			var tariffDetailsViewModel = new TariffDetailsViewModel();
			if (DialogService.ShowModalWindow(tariffDetailsViewModel))
			{
				DbCache.CreateTariff(tariffDetailsViewModel.Tariff);
				DbCache.AddJournalForUser(JournalType.AddTariff, tariffDetailsViewModel.Tariff);
				var tariffViewModel = new TariffViewModel(tariffDetailsViewModel.Tariff);
				Tariffs.Add(tariffViewModel);
				SelectedTariff = tariffViewModel;
			}
		}