Exemple #1
0
        public async Task<IActionResult> Edit(int id, [Bind("ConnectionTypeId,ConnectionTypeName")] LookUpConnectionType lookUpConnectionType)
        {
            if (id != lookUpConnectionType.ConnectionTypeId)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lookUpConnectionType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LookUpConnectionTypeExists(lookUpConnectionType.ConnectionTypeId))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                return RedirectToAction(nameof(Index));
            }
            return View(lookUpConnectionType);
        }
Exemple #2
0
 public async Task<IActionResult> Create([Bind("ConnectionTypeId,ConnectionTypeName")] LookUpConnectionType lookUpConnectionType)
 {
     if (ModelState.IsValid)
     {
         _context.Add(lookUpConnectionType);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(lookUpConnectionType);
 }