public int DeleteJobSeeker(Models.JobSeekerViewModel jobSeeker) { using (JwadDbContext db = new JwadDbContext()) { var delete = db.JobSeekers.Where(m => m.JobSeekerId == jobSeeker.JobSeekerId).SingleOrDefault(); db.JobSeekers.Remove(delete); db.SaveChanges(); } return(jobSeeker.JobSeekerId); }
public int DeleteJob(JobViewModel job) { using (JwadDbContext db = new JwadDbContext()) { var delete = db.JobRequirements.Where(m => m.JobRequirementId == job.JobRequirementId).SingleOrDefault(); db.JobRequirements.Remove(delete); db.SaveChanges(); } return(job.JobRequirementId); }
public int AddJobSeeker(Models.JobSeekerViewModel model, string userId) { int jobSeekerId; using (JwadDbContext db = new JwadDbContext()) { JobSeeker jobSeeker = new JobSeeker { FirstName = model.FirstName, LastName = model.LastName, Resume = model.Resume }; db.JobSeekers.Add(jobSeeker); db.SaveChanges(); jobSeekerId = jobSeeker.JobSeekerId; } return(jobSeekerId); }
public int AddJob(JobViewModel model, string userId) { int jobId; using (JwadDbContext db = new JwadDbContext()) { Job job = new Job { JobCity = model.JobCity, JobDescription = model.JobDescription, JobTitle = model.JobTitle, JobState = model.JobState, JobZipCode = model.JobZipCode }; db.JobRequirements.Add(job); db.SaveChanges(); jobId = job.JobRequirementId; } return(jobId); }