Example #1
0
 public IActionResult Create([Bind("Id,Name,ContactNumber")] Candidate candidate)
 {
     if (ModelState.IsValid)
     {
         _context.Add(candidate);
         _context.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     return(View(candidate));
 }
Example #2
0
 public IActionResult Create([Bind("Id,Name,ContactNumber,WebSite")] Employer employer)
 {
     if (ModelState.IsValid)
     {
         _context.Add(employer);
         _context.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     return(View(employer));
 }
Example #3
0
 public IActionResult Create([Bind("Id,Title,Description,EmployerId,SalaryInformation,JobType")] Advertisement advertisement)
 {
     if (ModelState.IsValid)
     {
         _context.Add(advertisement);
         _context.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["EmployerId"] = new SelectList(_context.Set <Employer>(), "Id", "Id", advertisement.EmployerId);
     return(View(advertisement));
 }
 public IActionResult Create([Bind("Id,AdvertisementId,CandidateId")] Application application)
 {
     if (ModelState.IsValid)
     {
         _context.Add(application);
         _context.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["AdvertisementId"] = new SelectList(_context.Advertisement.Include(a => a.Employer), "Id", "AdvertisementDisplayId", application.AdvertisementId);
     ViewData["CandidateId"]     = new SelectList(_context.Set <Candidate>(), "Id", "RegsitrationNumber", application.CandidateId);
     return(View(application));
 }