コード例 #1
0
        public async Task <IActionResult> Create([Bind("SavedSearchID,CandidateID,EmployerID,SearchedTerm")] SavedSearch savedSearch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(savedSearch);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(savedSearch));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("UserID,FullName,Email,PhoneNumber")] Candidate candidate)
        {
            if (ModelState.IsValid)
            {
                _context.Add(candidate);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(candidate));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("JobCreatedID,UserID,JobPostingID")] JobCreated jobCreated)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobCreated);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobCreated));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("UserID,FullName,Company,JobTitle,Email,Phone,YearEstablished,Biography")] Employer employer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employer));
        }
コード例 #5
0
        public async Task <IActionResult> Create([Bind("ResumeID,UserID,Language,Email,Phone,HighestEducation,WorkExperience,Skills")] Resume resume)
        {
            if (ModelState.IsValid)
            {
                _context.Add(resume);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserID"] = new SelectList(_context.Candidates, "UserID", "FullName", resume.UserID);
            return(View(resume));
        }
コード例 #6
0
        public async Task <IActionResult> Create([Bind("NotificationID,UserID,Date,Description,Type")] Notification notification)
        {
            if (ModelState.IsValid)
            {
                _context.Add(notification);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserID"] = new SelectList(_context.Candidates, "UserID", "FullName", notification.UserID);
            ViewData["UserID"] = new SelectList(_context.Employers, "UserID", "Company", notification.UserID);
            return(View(notification));
        }
コード例 #7
0
        public async Task <IActionResult> Create([Bind("ApplicationID,Date,Coverletter,JobPostingID,UserID,ResumeID")] JobApplication jobApplication)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobApplication);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserID"]       = new SelectList(_context.Candidates, "UserID", "FullName", jobApplication.UserID);
            ViewData["JobPostingID"] = new SelectList(_context.JobPostings, "JobPostingID", "JobPostingID", jobApplication.JobPostingID);
            ViewData["ResumeID"]     = new SelectList(_context.Resumes, "ResumeID", "ResumeID", jobApplication.ResumeID);
            return(View(jobApplication));
        }
コード例 #8
0
      public async Task <IActionResult> Create([Bind("JobPostingID,Company,Description,CompanyAddress,Email,Salary,UserID")] JobPosting jobPosting)
      {
          if (ModelState.IsValid)
          {
              _context.Add(jobPosting);

              await _context.SaveChangesAsync();

              JobCreated jobCreated = new JobCreated();
              jobCreated.UserID       = User.Identity.Name;
              jobCreated.JobPostingID = jobPosting.JobPostingID;
              _context.Add(jobCreated);
              await _context.SaveChangesAsync();

              return(RedirectToAction(nameof(Index)));
          }
          ViewData["UserID"] = new SelectList(_context.Employers, "UserID", "Company", jobPosting.UserID);
          return(View(jobPosting));
      }