Esempio n. 1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(BarclaysPayment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BarclaysPaymentExists(BarclaysPayment.BarclaysPaymentID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            Note.UpdatedDate = DateTime.Now;
            Note.UpdatedBy   = User.Identity.Name;

            _context.Attach(Note).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NoteExists(Note.NoteID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync(int?id, int?OrderStatus, bool?PracticeTestBooked, bool?PracticeMaterialsSent)
        {
            if (id != null)
            {
                IELTSOrder = await _context.IELTSOrder
                             .FirstOrDefaultAsync(m => m.BarclaysPaymentID == id);
            }

            if (OrderStatus != null)
            {
                IELTSOrder.OrderStatusID = OrderStatus;
            }

            if (PracticeTestBooked != null)
            {
                IELTSOrder.PracticeTestBooked = (bool)PracticeTestBooked;
            }

            if (PracticeMaterialsSent != null)
            {
                IELTSOrder.PracticeMaterialsSent = (bool)PracticeMaterialsSent;
            }

            ModelState.Remove("IELTSOrder.IELTSTestDate");

            //if (!ModelState.IsValid)
            //{
            //    return Page();
            //}

            _context.Attach(IELTSOrder).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!IELTSOrderExists(IELTSOrder.IELTSOrderID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }