Esempio n. 1
0
        public async Task <IActionResult> OnGetAsync()
        {
            Couple = await GetAuthorizedCouple();

            if (Couple == null)
            {
                return(NotFound());
            }

            if (!Couple.Dinner.HasPrice)
            {
                return(Redirect(ModelPath.Get <Couples.EditCoupleModel>()));
            }

            var status = await Couple.UpdatePaymentStatus();

            if (status.Changed)
            {
                await Database.SaveChangesAsync();
            }

            PaymentStatus = status.NewStatus;

            return(Page());
        }
Esempio n. 2
0
        public async Task <IActionResult> OnGetAsync()
        {
            Couple = await GetAuthorizedCouple();

            if (Couple == null)
            {
                return(NotFound());
            }

            var status = await Couple.UpdatePaymentStatus();

            if (status.Changed)
            {
                await Database.SaveChangesAsync();
            }

            return(Page());
        }