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

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ParametersExists(ItemParameter.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

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

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

            return(RedirectToPage("./Index"));
        }
예제 #3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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

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

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

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

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

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

            return(RedirectToPage("./Index"));
        }
예제 #6
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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