示例#1
0
        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));
        }
示例#3
0
 public JobPostings AddJobPosting([FromBody] JobPostings newPosting)
 {
     if (!ModelState.IsValid)
     {
         return(null);
     }
     return(_JobPostingService.AddJobPosting(newPosting));
 }
示例#4
0
        public JobPostings UpdateJobPosting([FromBody] JobPostings updatedJob)
        {
            if (!ModelState.IsValid)
            {
                return(null);
            }

            return(_JobPostingService.UpdateJobPosting(updatedJob));
        }
示例#5
0
    public List <JobPosting> GetAllJobPostings()
    {
        List <JobPosting> jobPostingsList = new List <JobPosting>();

        JobPostings jobPostingManager = new JobPostings();

        jobPostingsList = jobPostingManager.GetAllJobPostings();

        return(jobPostingsList);
    }
示例#6
0
    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"));
     }
 }
示例#9
0
        public JobPostings UpdateJobPosting(JobPostings updatedJob)
        {
            var existingJob = _context.JobPostings.Update(updatedJob);

            if (existingJob != null)
            {
                _context.SaveChanges();
                return(updatedJob);
            }
            else
            {
                return(null);
            }
        }
示例#10
0
        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();
                }
            }
        }
示例#11
0
        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();
        }
示例#12
0
    public bool DeleteJobPosting(string jobID)
    {
        JobPostings jobPostingManager = new JobPostings();

        return(jobPostingManager.DeleteJobPosting(jobID));
    }
示例#13
0
 public JobPostings UpdateJobPosting(JobPostings updatedJob)
 {
     return(_JobPostingRepository.UpdateJobPosting(updatedJob));
 }
示例#14
0
 public JobPostings AddJobPosting(JobPostings newPosting)
 {
     return(_JobPostingRepository.AddJobPosting(newPosting));
 }
示例#15
0
    public JobPosting GetJobPosting(int JobPostingID)
    {
        JobPostings JobPostingManager = new JobPostings();

        return(JobPostingManager.GetJobPosting(JobPostingID));
    }
示例#16
0
 /// <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));
        }
示例#19
0
    public bool UpdateJobPosting(JobPosting jobPosting)
    {
        JobPostings jobPostingManager = new JobPostings();

        return(jobPostingManager.UpdateJobPosting(jobPosting));
    }
示例#20
0
    public int AddJobPosting(JobPosting job)
    {
        JobPostings jobPostingManager = new JobPostings();

        return(jobPostingManager.AddJobPosting(job));
    }