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

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

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