예제 #1
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));
      }
예제 #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("SavedSearchID,CandidateID,EmployerID,SearchedTerm")] SavedSearch savedSearch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(savedSearch);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(savedSearch));
        }
예제 #4
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));
        }
예제 #5
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));
        }
예제 #6
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));
        }
예제 #7
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));
        }
        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));
        }