예제 #1
0
 public List <Skill> GetSkills(int profile_id)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.Skill.Where(x => x.Profile_Id == profile_id).ToList());
     }
 }
예제 #2
0
 public List <Job> GetJobs()
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.Job.Include("Employer").Include("JobSeekerRates").Include("RequiredSkill").ToList());
     }
 }
예제 #3
0
 public int GetIdByUsername(string username)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.JobSeeker.SingleOrDefault(x => x.Username == username).Id);
     }
 }
예제 #4
0
 public bool ExistsRateByJob(int job_id, int jobSeeker_Id)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.EmployerRates.Any(x => x.Job_Id == job_id && x.JobSeeker_Id == jobSeeker_Id));
     }
 }
예제 #5
0
 public List <EmployerRates> GetRates()
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.EmployerRates.ToList());
     }
 }
예제 #6
0
 public Job Select(int id)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.Job.Include("Employer").Include("JobSeekerRates").Include("RequiredSkill").SingleOrDefault(x => x.Id == id));
     }
 }
예제 #7
0
 public List <Employer> GetEmployers()
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.Employer.Include("Job").Include("EmployerRates").ToList());
     }
 }
예제 #8
0
 public List <RequiredSkill> GetRequiredSkills(int job_id)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.RequiredSkill.Where(x => x.Job_Id == job_id).ToList());
     }
 }
예제 #9
0
 public JobSeeker Select(int id)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.JobSeeker.Include("Profile").Include("JobSeekerRates").SingleOrDefault(x => x.Id == id));
     }
 }
예제 #10
0
 public Employer Select(int id)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.Employer.Include("Job").Include("EmployerRates").SingleOrDefault(x => x.Id == id));
     }
 }
예제 #11
0
 public List <JobSeeker> GetJobSeekers()
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.JobSeeker.Include("JobSeekerRates").Include("Profile").ToList());
     }
 }
예제 #12
0
 public void Insert(EmployerRates obj)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         context.EmployerRates.Add(obj);
         context.SaveChanges();
     }
 }
예제 #13
0
 public void Insert(Job obj)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         context.Job.Add(obj);
         context.SaveChanges();
     }
 }
예제 #14
0
 public void Insert(RequiredSkill obj)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         context.RequiredSkill.Add(obj);
         context.SaveChanges();
     }
 }
예제 #15
0
 public Profile Select(int id)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         return(context.Profile.Include("EmployerRates")
                .Include("JobSeeker")
                .Include("Skill").SingleOrDefault(x => x.JobSeeker_Id == id));
     }
 }
예제 #16
0
        public void Delete(int id)
        {
            Profile profile = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                profile = context.Profile.SingleOrDefault(x => x.JobSeeker_Id == id);
                if (profile != null)
                {
                    context.Profile.Remove(profile);
                    context.SaveChanges();
                }
            }
        }
예제 #17
0
        public void Delete(int id)
        {
            JobSeeker jobSeeker = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                jobSeeker = context.JobSeeker.SingleOrDefault(x => x.Id == id);
                if (jobSeeker != null)
                {
                    context.JobSeeker.Remove(jobSeeker);
                    context.SaveChanges();
                }
            }
        }
예제 #18
0
        public void Delete(int job_id, string skill)
        {
            RequiredSkill obj = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                obj = context.RequiredSkill.SingleOrDefault(x => x.Job_Id == job_id && x.Skill == skill);
                if (obj != null)
                {
                    context.RequiredSkill.Remove(obj);
                    context.SaveChanges();
                }
            }
        }
예제 #19
0
        public void Delete(int employer_Id, int jobSeeker_Id, int job_Id)
        {
            EmployerRates rate = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                rate = context.EmployerRates.SingleOrDefault(x => x.JobSeeker_Id == jobSeeker_Id && x.Job_Id == job_Id && x.Employer_Id == employer_Id);
                if (rate != null)
                {
                    context.EmployerRates.Remove(rate);
                    context.SaveChanges();
                }
            }
        }
예제 #20
0
        public void Delete(int profile_id, string skill)
        {
            Skill obj = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                obj = context.Skill.SingleOrDefault(x => x.Profile_Id == profile_id && x.Skill1 == skill);
                if (obj != null)
                {
                    context.Skill.Remove(obj);
                    context.SaveChanges();
                }
            }
        }
예제 #21
0
        public void Delete(int id)
        {
            Employer employer = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                employer = context.Employer.SingleOrDefault(x => x.Id == id);
                if (employer != null)
                {
                    context.Employer.Remove(employer);
                    context.SaveChanges();
                }
            }
        }
예제 #22
0
        public void Delete(int id)
        {
            Job job = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                job = context.Job.FirstOrDefault(x => x.Id == id);
                if (job != null)
                {
                    context.Job.Remove(job);
                    context.SaveChanges();
                }
            }
        }
예제 #23
0
 public void DeleteAllRates(int employer_id)
 {
     using (JobMatchEntities context = new JobMatchEntities())
     {
         if (context.EmployerRates.Any(x => x.Employer_Id == employer_id))
         {
             var rates = context.EmployerRates.Where(x => x.Employer_Id == employer_id);
             foreach (EmployerRates rate in rates)
             {
                 context.EmployerRates.Remove(rate);
             }
             context.SaveChanges();
         }
     }
 }
예제 #24
0
        public void Update(Employer obj)
        {
            Employer emp = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                emp = context.Employer.SingleOrDefault(x => x.Id == obj.Id);
                if (emp != null)
                {
                    emp.Email    = obj.Email;
                    emp.Password = obj.Password;
                    emp.Username = obj.Username;
                    context.SaveChanges();
                }
            }
        }
예제 #25
0
        public void Update(JobSeeker obj)
        {
            JobSeeker jobSeeker = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                jobSeeker = context.JobSeeker.SingleOrDefault(x => x.Id == obj.Id);
                if (jobSeeker != null)
                {
                    jobSeeker.Email    = obj.Email;
                    jobSeeker.Password = obj.Password;
                    jobSeeker.Username = obj.Username;
                    context.SaveChanges();
                }
            }
        }
예제 #26
0
        public void Update(Job obj)
        {
            Job job = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                job = context.Job.SingleOrDefault(x => x.Id == obj.Id);
                if (job != null)
                {
                    job.AditionalRequirements = obj.AditionalRequirements;
                    job.EducationRequirements = obj.EducationRequirements;
                    job.Employer_Id           = obj.Employer_Id;
                    job.JobDescription        = obj.JobDescription;
                    job.Position = obj.Position;
                    context.SaveChanges();
                }
            }
        }
예제 #27
0
        public void Update(Profile obj)
        {
            Profile profile = null;

            using (JobMatchEntities context = new JobMatchEntities())
            {
                profile = context.Profile.SingleOrDefault(x => x.JobSeeker_Id == obj.JobSeeker_Id);
                if (profile != null)
                {
                    profile.LastName         = obj.LastName;
                    profile.ShortDescription = obj.ShortDescription;
                    profile.WorkExperience   = obj.WorkExperience;
                    profile.Education        = obj.Education;
                    profile.ContactData      = obj.ContactData;
                    context.SaveChanges();
                }
            }
        }