public int addUser(JobFinderUser jobFinderUser) { jobFinderUser.Password = sha256_hash(jobFinderUser.Password); jobFinderUser.UserAddedAt = DateTime.Now; jobFinderUser.UserUpdatedAt = DateTime.Now; _dbContext.JobFinderUsers.Add(jobFinderUser); _dbContext.SaveChanges(); return(jobFinderUser.UserId); }
public void AssignUserToCompany(CompanyUser companyUser) { _dbContext.Add(companyUser); _dbContext.SaveChanges(); }
public void ModifyApplicationStatus(Application application) { _dbContext.Applications.Update(application); _dbContext.SaveChanges(); }
public int AddJobListing(JobListing jobListing, int userId) { _dbContext.JobListings.Add(jobListing); _dbContext.SaveChanges(); return(jobListing.JobListingId); }
public void AddTemplate(Template template) { _dbContext.Templates.Add(template); _dbContext.SaveChanges(); }
public int AddCompany(Company company) { _dbContext.Add(company); _dbContext.SaveChanges(); return(company.CompanyId); }
public ActionResult Create(int jobId, IFormCollection collection) { Template jobTemplate = _templatesRepository.GetTemplateByJobId(jobId); int userIdCurrentlyLoggedIn = Int32.Parse(User.Claims.FirstOrDefault(uc => uc.Type == ClaimTypes.NameIdentifier).Value); Application application = new Application { Status = "Pending", UserId = userIdCurrentlyLoggedIn, ApplicationWrittenAt = DateTime.Now, JobListingId = jobId }; if (jobTemplate.OtherNotes == 1) { application.OtherNotes = collection["otherNotes"]; } int ApplicationId = _applicationsRepository.AddApplication(application); if (jobTemplate.WorkExperience == 1) { ApplicationWorkExperience newApplicationWorkExperience = new ApplicationWorkExperience { CompanyName = collection["workExpCompanyName"], StartDate = DateTime.Parse(collection["workExpStartDate"]), EndDate = DateTime.Parse(collection["workExpEndDate"]), Position = collection["workExpPosition"], Responsibilities = collection["workExpResponsibilities"], Duties = collection["workExpDuties"], ApplicationId = ApplicationId }; _dbContext.ApplicationWorkExperiences.Add(newApplicationWorkExperience); _dbContext.SaveChanges(); } if (jobTemplate.Skills == 1) { ApplicationSkill newApplicationSkill = new ApplicationSkill { Name = collection["skillName"], Rating = Int16.Parse(collection["skillRating"]), Description = collection["skillDescription"], ApplicationId = ApplicationId }; _dbContext.ApplicationSkills.Add(newApplicationSkill); _dbContext.SaveChanges(); } if (jobTemplate.Education == 1) { ApplicationEducation newApplicationEducation = new ApplicationEducation { SchoolName = collection["schoolName"], StartDate = DateTime.Parse(collection["educationStartDate"]), EndDate = DateTime.Parse(collection["educationEndDate"]), Degree = collection["educationDegree"], ApplicationId = ApplicationId }; _dbContext.ApplicationEducations.Add(newApplicationEducation); _dbContext.SaveChanges(); } ViewBag.SelectedNav = "Jobs"; return(RedirectToAction("Index", "Jobs")); }
public void AddCategory(Category category) { category.Slug = GenerateCategorySlug(category.Name); _dbContext.Add(category); _dbContext.SaveChanges(); }