Exemplo n.º 1
0
		void OnEdit()
		{
			var depositDetailsViewModel = new DepositDetailsViewModel(SelectedDeposit.Deposit, false);
			if (DialogService.ShowModalWindow(depositDetailsViewModel))
			{
				var deposit = depositDetailsViewModel.GetDeposit();
				SelectedDeposit.Update(deposit);
				DbCache.SaveDeposit(SelectedDeposit.Deposit);
				DbCache.AddJournalForUser(JournalType.EditDeposit, deposit, string.Format("Сумма: {0} руб.", deposit.Amount));
			}
		}
Exemplo n.º 2
0
		void OnAdd()
		{
			var depositDetailsViewModel = new DepositDetailsViewModel(new Deposit 
			{ 
				Name = "ЛС: " + Consumer.Number,
				ConsumerUID = Consumer.UID, 
				Moment = DateTime.Now 
			}, true);
			if (DialogService.ShowModalWindow(depositDetailsViewModel))
			{
				var deposit = depositDetailsViewModel.GetDeposit();
				var depositViewModel = new DepositViewModel(deposit);
				Deposits.Add(depositViewModel);
				SelectedDeposit = depositViewModel;
				DbCache.SaveDeposit(deposit);
				DbCache.AddJournalForUser(JournalType.AddDeposit, deposit, string.Format("Сумма: {0} руб.", deposit.Amount));
			}
		}