Ejemplo n.º 1
0
        private async Task DeletePaymentStatuses(PaymentStatusTableViewModel paymentStatus)
        {
            var a = "";

            if (await _pageService.DisplayAlert("Warning", $"Are you sure you want to delete{paymentStatus.StudentID}?", "Yes", "No"))
            {
                PaymentStatus.Remove(paymentStatus);
                var userPaymentStatus = await _paymentStatusStore.GetPaymentStatus(paymentStatus.Id);

                await _paymentStatusStore.DeletePaymentStatus(userPaymentStatus);
            }
        }
Ejemplo n.º 2
0
        public PaymentStatusDetailViewModel(PaymentStatusTableViewModel viewModel, IPaymentStatus paymentStatusStore, IPageService pageService)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            _pageService        = pageService;
            _paymentStatusStore = paymentStatusStore;

            SaveCommand = new Command(async() => await Save());

            PaymentStatus = new PaymentStatus
            {
                id         = viewModel.Id,
                studentID  = viewModel.StudentID,
                courseID   = viewModel.CourseID,
                amountPaid = viewModel.AmountPaid,
                fee        = viewModel.Fee,
                date       = viewModel.Date
            };
        }
Ejemplo n.º 3
0
        private async Task SelectPaymentStatuses(PaymentStatusTableViewModel paymentStatus)
        {
            if (paymentStatus == null)
            {
                return;
            }

            SelectedPaymentStatus = null;

            var viewModel = new PaymentStatusDetailViewModel(paymentStatus, _paymentStatusStore, _pageService);

            viewModel.PaymentStatusUpdated += (source, updatePaymentStatus) =>
            {
                paymentStatus.Id         = updatePaymentStatus.id;
                paymentStatus.StudentID  = updatePaymentStatus.studentID;
                paymentStatus.CourseID   = updatePaymentStatus.courseID;
                paymentStatus.AmountPaid = updatePaymentStatus.amountPaid;
                paymentStatus.Fee        = updatePaymentStatus.fee;
                paymentStatus.Date       = updatePaymentStatus.date;
            };

            await _pageService.PushModalAsync(new PaymentStatusDetailPage(viewModel));
        }