Example #1
0
        public IActionResult Edit(int id, [Bind("Id,Name,ContactNumber")] Candidate candidate)
        {
            if (id != candidate.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(candidate);
                    _context.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CandidateExists(candidate.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(candidate));
        }
Example #2
0
        public IActionResult Edit(int id, [Bind("Id,Name,ContactNumber,WebSite")] Employer employer)
        {
            if (id != employer.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employer);
                    _context.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployerExists(employer.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employer));
        }
        public IActionResult Edit(int id, [Bind("Id,AdvertisementId,CandidateId")] Application application)
        {
            if (id != application.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(application);
                    _context.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ApplicationExists(application.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AdvertisementId"] = new SelectList(_context.Advertisement, "Id", "Id", application.AdvertisementId);
            ViewData["CandidateId"]     = new SelectList(_context.Set <Candidate>(), "Id", "Id", application.CandidateId);
            return(View(application));
        }
Example #4
0
        public IActionResult Edit(int id, [Bind("Id,Title,Description,EmployerId,SalaryInformation,JobType")] Advertisement advertisement)
        {
            if (id != advertisement.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(advertisement);
                    _context.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdvertisementExists(advertisement.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployerId"] = new SelectList(_context.Set <Employer>(), "Id", "Id", advertisement.EmployerId);
            return(View(advertisement));
        }