public JobPostings AddJobPosting(JobPostings newPosting) { _context.JobPostings.Add(newPosting); _context.SaveChanges(); return(newPosting); }
public async Task <IActionResult> Edit(int id, [Bind("JobId,Company,Description,DurationMonths")] JobPostings jobPostings) { if (id != jobPostings.JobId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(jobPostings); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JobPostingsExists(jobPostings.JobId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(jobPostings)); }
public JobPostings AddJobPosting([FromBody] JobPostings newPosting) { if (!ModelState.IsValid) { return(null); } return(_JobPostingService.AddJobPosting(newPosting)); }
public JobPostings UpdateJobPosting([FromBody] JobPostings updatedJob) { if (!ModelState.IsValid) { return(null); } return(_JobPostingService.UpdateJobPosting(updatedJob)); }
public List <JobPosting> GetAllJobPostings() { List <JobPosting> jobPostingsList = new List <JobPosting>(); JobPostings jobPostingManager = new JobPostings(); jobPostingsList = jobPostingManager.GetAllJobPostings(); return(jobPostingsList); }
public JobPosting GetJobPostingDetails(int jobPostingID) { JobPosting aJobPosting = new JobPosting(); JobPostings jobPostingManager = new JobPostings(); aJobPosting = jobPostingManager.GetJobPostingDetails(jobPostingID); return(aJobPosting); }
public async Task <IActionResult> Create([Bind("JobId,Company,Description,DurationMonths")] JobPostings jobPostings) { if (ModelState.IsValid) { _context.Add(jobPostings); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(jobPostings)); }
public IActionResult CreateJobs(JobPostings JobPost) { using (var db = new jobsDBContext()) { var userId = int.Parse(HttpContext.Session.GetString("UserId")); JobPost.RecruiterId = userId; JobPost.IsActive = true; JobPost.AddedDate = DateTime.Now; db.JobPostings.Add(JobPost); db.SaveChanges(); return(RedirectToAction("ManageJobs")); } }
public JobPostings UpdateJobPosting(JobPostings updatedJob) { var existingJob = _context.JobPostings.Update(updatedJob); if (existingJob != null) { _context.SaveChanges(); return(updatedJob); } else { return(null); } }
private void CheckJobPostings() { DateTime now = DateTime.Now; List <JobPostings> validJobs = _context.JobPostings .AsNoTracking() .Where(x => x.Active) .ToList(); foreach (JobPostings job in validJobs) { if (job.ValidThrough < now) { JobPostings invalidJob = _context.JobPostings.Where(x => x.JobId == job.JobId).FirstOrDefault(); invalidJob.Active = false; _context.SaveChanges(); } } }
protected void Page_Load(object sender, EventArgs args) { var query = from jp in XrmContext.CreateQuery("adx_jobposting") where jp.GetAttributeValue <EntityReference>("adx_websiteid") == Website.ToEntityReference() where jp.GetAttributeValue <OptionSetValue>("statecode") != null && jp.GetAttributeValue <OptionSetValue>("statecode").Value == 0 orderby jp.GetAttributeValue <string>("adx_name") select new { Id = jp.GetAttributeValue <Guid>("adx_jobpostingid"), Name = jp.GetAttributeValue <string>("adx_name"), Description = jp.GetAttributeValue <string>("adx_description"), ClosingOn = jp.GetAttributeValue <DateTime?>("adx_closingon") }; var postings = query.ToArray().Where(e => IsOpen(e.ClosingOn)); JobPostings.DataSource = postings; JobPostings.DataBind(); }
public bool DeleteJobPosting(string jobID) { JobPostings jobPostingManager = new JobPostings(); return(jobPostingManager.DeleteJobPosting(jobID)); }
public JobPostings UpdateJobPosting(JobPostings updatedJob) { return(_JobPostingRepository.UpdateJobPosting(updatedJob)); }
public JobPostings AddJobPosting(JobPostings newPosting) { return(_JobPostingRepository.AddJobPosting(newPosting)); }
public JobPosting GetJobPosting(int JobPostingID) { JobPostings JobPostingManager = new JobPostings(); return(JobPostingManager.GetJobPosting(JobPostingID)); }
/// <summary> /// Click the Job Postings link on the main menu /// </summary> public void ClickJobPostings() { JobPostings.WaitRetry(_driver).Click(); }
public ActionResult CreateJobPost(string title, string description, string contactInfo) { JobPostings job = new JobPostings(title, description, contactInfo); return(RedirectToAction("Index")); }
public ActionResult Index() { List <JobPostings> allJobPostings = JobPostings.GetAll(); return(View(allJobPostings)); }
public bool UpdateJobPosting(JobPosting jobPosting) { JobPostings jobPostingManager = new JobPostings(); return(jobPostingManager.UpdateJobPosting(jobPosting)); }
public int AddJobPosting(JobPosting job) { JobPostings jobPostingManager = new JobPostings(); return(jobPostingManager.AddJobPosting(job)); }