예제 #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SpeakerExists(Speaker.SpeakerID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Redirect($"/SacramentPlans/Index?id={Speaker.SacramentPlanID}"));
        }
예제 #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.SacramentPlan.Add(SacramentPlan);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
예제 #3
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Speaker.Add(Speaker);
            await _context.SaveChangesAsync();

            return(Redirect($"/SacramentPlans/Index?id={Speaker.SacramentPlanID}"));
        }
예제 #4
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Speaker = await _context.Speaker.FindAsync(id);

            if (Speaker != null)
            {
                _context.Speaker.Remove(Speaker);
                await _context.SaveChangesAsync();
            }

            return(Redirect($"/SacramentPlans/Index?id={Speaker.SacramentPlanID}"));
        }
예제 #5
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            SacramentPlan = await _context.SacramentPlan.FindAsync(id);

            if (SacramentPlan != null)
            {
                _context.SacramentPlan.Remove(SacramentPlan);
                await _context.SaveChangesAsync();
            }

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