コード例 #1
0
 private void PrepareDefault(PaymentType type)
 {
     SelectedPayment = new PaymentViewModel
     {
         Type           = type,
         Date           = DateTime.Now,
         ChargedAccount = ChargedAccounts.FirstOrDefault(),
     };
     IsTransfer = type == PaymentType.Transfer;
     EndDate    = DateTime.Now;
 }
コード例 #2
0
 private void SetDefaultPayment(PaymentType paymentType)
 {
     SelectedPayment = new PaymentViewModel
     {
         Type = paymentType,
         Date = DateTime.Now,
         // Assign empty CategoryViewModel to reset the GUI
         Category       = new CategoryViewModel(),
         ChargedAccount = ChargedAccounts.FirstOrDefault()
     };
 }
コード例 #3
0
        public override async Task Initialize()
        {
            await base.Initialize().ConfigureAwait(true);

            SelectedPayment.ChargedAccount = ChargedAccounts.FirstOrDefault();

            if (SelectedPayment.IsTransfer)
            {
                SelectedItemChangedCommand.Execute();
                SelectedPayment.TargetAccount = TargetAccounts.FirstOrDefault();
            }
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
        private void PrepareEdit()
        {
            IsTransfer = SelectedPayment.IsTransfer;
            // set the private amount property. This will get properly formatted and then displayed.
            amount     = SelectedPayment.Amount;
            Recurrence = SelectedPayment.IsRecurring
                ? SelectedPayment.RecurringPayment.Recurrence
                : PaymentRecurrence.Daily;
            EndDate = SelectedPayment.IsRecurring
                ? SelectedPayment.RecurringPayment.EndDate
                : DateTime.Now;
            IsEndless = !SelectedPayment.IsRecurring || SelectedPayment.RecurringPayment.IsEndless;

            // we have to set the AccountViewModel objects here again to ensure that they are identical to the
            // objects in the AccountViewModel collections.
            selectedPayment.ChargedAccount =
                ChargedAccounts.FirstOrDefault(x => x.Id == selectedPayment.ChargedAccountId);
            selectedPayment.TargetAccount =
                TargetAccounts.FirstOrDefault(x => x.Id == selectedPayment.TargetAccountId);
        }
コード例 #6
0
        public new async Task InitializeAsync()
        {
            await base.InitializeAsync();

            SelectedPayment.ChargedAccount = ChargedAccounts.FirstOrDefault();
        }