Esempio n. 1
0
        public async Task <IActionResult> PutJob(int id, Job job)
        {
            if (id != job.JobID)
            {
                return(BadRequest());
            }

            _context.Entry(job).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!JobExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> Create([Bind("EmployerID,Name,EmailId,Company,Mobile,Website")] Employer employer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employer));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create([Bind("SavedSearchId,CandidateId,JobPostingId")] SavedSearch savedSearch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(savedSearch);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(savedSearch));
        }
Esempio n. 4
0
        public async Task <IActionResult> Create([Bind("CandidateId,EmailId,FirstName,LastName,Mobile,Gender,Age,Province,City,Skills,registration_date")] Candidate candidate)
        {
            if (ModelState.IsValid)
            {
                _context.Add(candidate);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(candidate));
        }
        public async Task <IActionResult> Create([Bind("JobId,Title,Description,EmployerId,IsActive")] JobPosting jobPosting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobPosting);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployerId"] = new SelectList(_context.Employers, "EmployerID", "EmployerID", jobPosting.EmployerId);
            return(View(jobPosting));
        }
Esempio n. 6
0
        public async Task <IActionResult> Create([Bind("ResumeId,CandidateId,education,experience,skills")] Resume resume)
        {
            if (ModelState.IsValid)
            {
                _context.Add(resume);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CandidateId"] = new SelectList(_context.Candidates, "CandidateId", "CandidateId", resume.CandidateId);
            return(View(resume));
        }
        public async Task <IActionResult> Create([Bind("NotificationId,EmployerId,CandidateId,Text,IsRead")] Notification notification)
        {
            if (ModelState.IsValid)
            {
                _context.Add(notification);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CandidateId"] = new SelectList(_context.Candidates, "CandidateId", "CandidateId", notification.CandidateId);
            ViewData["EmployerId"]  = new SelectList(_context.Employers, "EmployerID", "EmployerID", notification.EmployerId);
            return(View(notification));
        }
        public async Task <IActionResult> Create([Bind("JobApplicationId,CandidateId,JobPostingId,AppliedDate,ResumeId")] JobApplication jobApplication)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobApplication);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CandidateId"]  = new SelectList(_context.Candidates, "CandidateId", "CandidateId", jobApplication.CandidateId);
            ViewData["JobPostingId"] = new SelectList(_context.JobPostings, "JobId", "JobId", jobApplication.JobPostingId);
            ViewData["ResumeId"]     = new SelectList(_context.Resumes, "ResumeId", "ResumeId", jobApplication.ResumeId);
            return(View(jobApplication));
        }