Ejemplo n.º 1
0
        public async Task <ActionResult <Klopapier> > PostKlopapier(Klopapier klopapier)
        {
            _context.Klopapier.Add(klopapier);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetKlopapier", new { id = klopapier.Id }, klopapier));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,AnzahlBlatt,Hersteller,Produkt,Langen,Duft")] Klopapier klopapier)
        {
            if (id != klopapier.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(klopapier);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KlopapierExists(klopapier.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(klopapier));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> PutKlopapier(int id, Klopapier klopapier)
        {
            if (id != klopapier.Id)
            {
                return(BadRequest());
            }

            _context.Entry(klopapier).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!KlopapierExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Id,AnzahlBlatt,Hersteller,Produkt,Langen,Duft")] Klopapier klopapier)
        {
            if (ModelState.IsValid)
            {
                _context.Add(klopapier);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(klopapier));
        }