public override void Prepare(ModifyPaymentParameter parameter) { SelectedPayment = new PaymentViewModel { Type = parameter.PaymentType }; Title = PaymentTypeHelper.GetViewTitleForType(parameter.PaymentType, false); base.Prepare(parameter); }
public override void Prepare(ModifyPaymentParameter parameter) { SelectedPayment = crudServices.ReadSingleAsync <PaymentViewModel>(parameter.PaymentId).Result; // We have to set this here since otherwise the end date is null. This causes a crash on android. // Also it's user unfriendly if you the default end date is the 1.1.0001. if (SelectedPayment.IsRecurring && SelectedPayment.RecurringPayment.IsEndless) { SelectedPayment.RecurringPayment.EndDate = DateTime.Today; } Title = PaymentTypeHelper.GetViewTitleForType(parameter.PaymentType, true); base.Prepare(parameter); }
protected override async Task Initialize() { Title = PaymentTypeHelper.GetViewTitleForType(PaymentType, false); SelectedPayment.Type = PaymentType; await base.Initialize(); SelectedPayment.ChargedAccount = ChargedAccounts.FirstOrDefault(); if (SelectedPayment.IsTransfer) { SelectedItemChangedCommand.Execute(null); SelectedPayment.TargetAccount = TargetAccounts.FirstOrDefault(); } }
protected override async Task Initialize() { await base.Initialize(); SelectedPayment = await crudServices.ReadSingleAsync <PaymentViewModel>(PaymentId); // We have to set this here since otherwise the end date is null. This causes a crash on android. // Also it's user unfriendly if you the default end date is the 1.1.0001. if (SelectedPayment.IsRecurring && SelectedPayment.RecurringPayment.IsEndless) { SelectedPayment.RecurringPayment.EndDate = DateTime.Today; } Title = PaymentTypeHelper.GetViewTitleForType(SelectedPayment.Type, true); }
protected override async Task Initialize() { await base.Initialize(); SelectedPayment = mapper.Map <PaymentViewModel>(await mediator.Send(new GetPaymentByIdQuery(PaymentId))); // We have to set this here since otherwise the end date is null. This causes a crash on android. // Also it's user unfriendly if you the default end date is the 1.1.0001. if (SelectedPayment.IsRecurring && SelectedPayment.RecurringPayment.IsEndless) { SelectedPayment.RecurringPayment.EndDate = DateTime.Today; } Title = PaymentTypeHelper.GetViewTitleForType(SelectedPayment.Type, true); }
protected async Task InitializeAsync(int paymentId) { try { await base.InitializeAsync(); SelectedPayment = mapper.Map <PaymentViewModel>(await mediator.Send(new GetPaymentByIdQuery(paymentId))); AmountString = HelperFunctions.FormatLargeNumbers(SelectedPayment.Amount); // We have to set this here since otherwise the end date is null. This causes a crash on android. // Also it's user unfriendly if you the default end date is the 1.1.0001. if (SelectedPayment.IsRecurring && SelectedPayment.RecurringPayment != null && SelectedPayment.RecurringPayment.IsEndless) { SelectedPayment.RecurringPayment.EndDate = DateTime.Today; } Title = PaymentTypeHelper.GetViewTitleForType(SelectedPayment.Type, true); } catch (PaymentNotFoundException ex) { Crashes.TrackError(ex); } }
public void GetEnumFrostring_TransferIntEditTrue_Titel() { Assert.AreEqual(Strings.EditTransferTitle, PaymentTypeHelper.GetViewTitleForType(2, true)); }
public void GetEnumFrostring_IncomeIntEditTrue_Titel() { Assert.AreEqual(Strings.EditIncomeTitle, PaymentTypeHelper.GetViewTitleForType(1, true)); }
public void GetEnumFrostring_IncomeEnumEditFalse_Titel() { Assert.AreEqual(Strings.AddIncomeTitle, PaymentTypeHelper.GetViewTitleForType(PaymentType.Income, false)); }
public void GetEnumFromString_TransferEnumEditTrue_Title() => Assert.Equal(Strings.EditTransferTitle, PaymentTypeHelper.GetViewTitleForType(PaymentType.Transfer, true));
public void GetEnumFromString_IncomeEnumEditTrue_Title() => Assert.Equal(Strings.EditIncomeTitle, PaymentTypeHelper.GetViewTitleForType(PaymentType.Income, true));
public void GetEnumFromString_TransferIntEditFalse_Title() => Assert.Equal(Strings.AddTransferTitle, PaymentTypeHelper.GetViewTitleForType(2, false));
public void GetEnumFromString_IncomeIntEditFalse_Title() => Assert.Equal(Strings.AddIncomeTitle, PaymentTypeHelper.GetViewTitleForType(1, false));
public void GetEnumFromString_ExpenseIntEditTrue_Title() => Assert.Equal(Strings.EditSpendingTitle, PaymentTypeHelper.GetViewTitleForType(0, true));
public void GetEnumFrostring_ExpenseIntEditFalse_Titel() { Assert.AreEqual(Strings.AddExpenseTitle, PaymentTypeHelper.GetViewTitleForType(0, false)); }
public void GetEnumFrostring_ExpenseEnumEditTrue_Titel() { Assert.AreEqual(Strings.EditSpendingTitle, PaymentTypeHelper.GetViewTitleForType(PaymentType.Expense, true)); }
public void GetEnumFromString_ExpenseEnumEditFalse_Title() => Assert.Equal(Strings.AddExpenseTitle, PaymentTypeHelper.GetViewTitleForType(PaymentType.Expense, false));
public void GetEnumFrostring_TransferEnumEditFalse_Titel() { Assert.AreEqual(Strings.AddTransferTitle, PaymentTypeHelper.GetViewTitleForType(PaymentType.Transfer, false)); }
public override void Prepare(ModifyPaymentParameter parameter) { SelectedPayment = crudServices.ReadSingleAsync <PaymentViewModel>(parameter.PaymentId).Result; Title = PaymentTypeHelper.GetViewTitleForType(parameter.PaymentType, true); base.Prepare(parameter); }