Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("DocumentNumber,Name,JobPositionID,Department,SalaryWished,Languages,RecommendedBy,ID")] Candidate candidate)
        {
            if (id != candidate.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(candidate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CandidateExists(candidate.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["JobPositionID"] = new SelectList(_context.JobPositions, "ID", "Name", candidate.JobPositionID);
            return(View(candidate));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,Risk,MinimumSalary,MaximumSalary,Status,ID")] JobPosition jobPosition)
        {
            if (id != jobPosition.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(jobPosition);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JobPositionExists(jobPosition.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobPosition));
        }