Beispiel #1
0
        public async Task <IActionResult> Edit(string id, [Bind("FeederLineTypeId,FeederLineTypeName")] LookUpFeederLineType lookUpFeederLineType)
        {
            if (id != lookUpFeederLineType.FeederLineTypeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lookUpFeederLineType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LookUpFeederLineTypeExists(lookUpFeederLineType.FeederLineTypeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(lookUpFeederLineType));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("FeederLineTypeId,FeederLineTypeName")] LookUpFeederLineType lookUpFeederLineType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lookUpFeederLineType);
                await _context.SaveChangesAsync();

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