public void DeleteEmployment(Guid id) { JobBoardDataContext db = new JobBoardDataContext(); EmploymentHistory emp = db.EmploymentHistories.Where(x => x.id.Equals(id)).FirstOrDefault<EmploymentHistory>(); db.EmploymentHistories.DeleteOnSubmit(emp); db.SubmitChanges(); }
public void Submit() { JobBoardDataContext db = new JobBoardDataContext(); Application app = new Application(); app = db.Applications.Where(x => x.id.Equals(this.id)).FirstOrDefault<Application>(); app.dateSubmitted = DateTime.Now; db.SubmitChanges(); SendNotifications(); }
public void SetMilitary(string branch, string start, string end, string rank_duties, string additional_info) { Application app = new Application(); JobBoardDataContext db = new JobBoardDataContext(); DateTime? startdate = null; DateTime? enddate = null; try { startdate = Convert.ToDateTime(start); } catch {} try { enddate = Convert.ToDateTime(end); } catch { } app = db.Applications.Where(x => x.id.Equals(this.id)).FirstOrDefault<Application>(); app.service_branch = branch; app.service_start = startdate; app.service_end = enddate; app.rank_duties = rank_duties; app.additional_info = additional_info; db.SubmitChanges(); }
public void Save() { JobBoardDataContext db = new JobBoardDataContext(); // Attempt to find a record with this ID HR.Reference existing = db.References.Where(x => x.id.Equals(this.id)).FirstOrDefault<HR.Reference>(); if (existing == null) { db.References.InsertOnSubmit(this); } else { existing.name = this.name; existing.job_title = this.job_title; existing.phone = this.phone; existing.years_known = this.years_known; } db.SubmitChanges(); }
public void Delete() { JobBoardDataContext db = new JobBoardDataContext(); HR.Reference refer = db.References.Where(x => x.id.Equals(this.id)).FirstOrDefault<HR.Reference>(); db.References.DeleteOnSubmit(refer); db.SubmitChanges(); }
public void Save() { JobBoardDataContext db = new JobBoardDataContext(); // Attempt to find a record with this ID EducationalBackground existing = db.EducationalBackgrounds.Where(x => x.id.Equals(this.id)).FirstOrDefault<EducationalBackground>(); if (existing == null) { // Insert db.EducationalBackgrounds.InsertOnSubmit(this); } else { // Update existing.school_type = this.school_type; existing.name = this.name; existing.address = this.address; existing.city = this.city; existing.state_id = this.state_id; existing.years_completed = this.years_completed; existing.gpa = this.gpa; existing.degree = this.degree; existing.app_id = this.app_id; existing.description = this.ParseNameLocation(); } db.SubmitChanges(); }
public void Delete() { JobBoardDataContext db = new JobBoardDataContext(); EducationalBackground edu = db.EducationalBackgrounds.Where(x => x.id.Equals(this.id)).FirstOrDefault<EducationalBackground>(); db.EducationalBackgrounds.DeleteOnSubmit(edu); db.SubmitChanges(); }