public async Task <IActionResult> Edit(int id, [Bind("Id,Omschrijving")] ProductieEenheid productieEenheid)
        {
            if (id != productieEenheid.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(productieEenheid);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductieEenheidExists(productieEenheid.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(productieEenheid));
        }
Example #2
0
 public vm_productie_eenheid(GmmDbContext pContext)
 {
     _context          = pContext;
     _productieEenheid = new ProductieEenheid {
         Id = 0
     };
 }
        public async Task <IActionResult> Create([Bind("Id,Omschrijving")] ProductieEenheid productieEenheid)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productieEenheid);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(productieEenheid));
        }
Example #4
0
 public void GetProductieEenheidById(int pProductieEenheidIdId)
 {
     _productieEenheid = (_context.ProductieEenheden.Where(b => b.Id == pProductieEenheidIdId).SingleOrDefault());
 }