Exemplo n.º 1
0
 public Boolean removeSkillFromJob(Job obj, String skillId)
 {
     try
     {
         IJobSvc svc = (IJobSvc)this.getService(typeof(IJobSvc).Name);
         return svc.removeSkillFromJob(obj, skillId);
     }
     catch (Exception ex)
     {
         return false;
     }
 }
Exemplo n.º 2
0
 public Boolean deleteJob(Job obj)
 {
     try
     {
         IJobSvc svc = (IJobSvc)this.getService(typeof(IJobSvc).Name);
         return svc.deleteJob(obj);
     }
     catch (ServiceLoadException ex)
     {
         return false;
     }
 }
Exemplo n.º 3
0
 public static JobDto createJobDTO(Job obj)
 {
     JobDto job = new JobDto();
     job.JobId = obj.JobId;
     job.JobName = obj.JobName;
     job.CompensationId = obj.CompensationId;
     job.EmployerId = obj.EmployerId;
     job.JobDescription = obj.JobDescription;
     job.JobQuota = obj.JobQuota;
     job.JobExperienceLevel = (double)obj.JobExperienceLevel;
     job.JobCompensationValue = (double)obj.JobCompensationValue;
     return job;
 }
Exemplo n.º 4
0
        public Boolean addSkillToJob(Job obj, String skillId)
        {
            using (NewJobBankContext db = new NewJobBankContext())
            {
                try
                {
                    Job Job = db.Jobs.SqlQuery("dbo.SelectJobById @JobId='" + obj.JobId.ToString() + "'").Single();
                    Skill skillAdd = db.Skills.SqlQuery("dbo.SelectSkillById @SkillId='" + skillId + "'").Single();

                    if (Job != null)
                    {
                        if (skillAdd != null)
                        {
                            Job.Skills.Add(skillAdd);
                        }

                        #region Database Submission with Rollback

                        try
                        {
                            db.SaveChanges();
                            return true;
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }
                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }
Exemplo n.º 5
0
        public Boolean deleteJob(Job obj)
        {
            using (NewJobBankContext db = new NewJobBankContext())
            {
                try
                {
                    Job job = db.Jobs.SqlQuery("dbo.SelectJobById @JobId='" + obj.JobId.ToString() + "'").Single();

                    if (job != null)
                    {
                        db.Jobs.Remove(job);
                        #region Database Submission

                        try
                        {
                            db.SaveChanges();
                            return true;
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }

                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }
Exemplo n.º 6
0
        public Boolean insertJob(Job obj)
        {
            using (NewJobBankContext db = new NewJobBankContext())
            {
                try
                {
                    db.Jobs.Add(obj);
                    db.SaveChanges();
                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }

            }
        }
Exemplo n.º 7
0
        public Boolean updateJob(Job obj)
        {
            using (NewJobBankContext db = new NewJobBankContext())
            {
                try
                {

                    Job job = db.Jobs.SqlQuery("dbo.SelectJobById @JobId='" + obj.JobId.ToString() + "'").Single();

                    if (job != null)
                    {
                        job.JobName = obj.JobName;
                        job.CompensationId = obj.CompensationId;
                        job.EmployerId = obj.EmployerId;
                        job.JobDescription = obj.JobDescription;
                        job.JobQuota = obj.JobQuota;
                        job.JobExperienceLevel = obj.JobExperienceLevel;
                        job.JobCompensationValue = obj.JobCompensationValue;

                        #region Database Submission with Rollback

                        try
                        {
                            db.SaveChanges();
                            return true;
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }
                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }

            }
        }
Exemplo n.º 8
0
        public Job selectJobById(Job obj)
        {
            NewJobBankContext db = new NewJobBankContext();

            try
            {
                return db.Jobs.SqlQuery("dbo.SelectJobById @JobId='" + obj.JobId.ToString() + "'").Single();
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Exemplo n.º 9
0
 public Job selectJobById(Job obj)
 {
     try
     {
         IJobSvc svc = (IJobSvc)this.getService(typeof(IJobSvc).Name);
         return svc.selectJobById(obj);
     }
     catch (ServiceLoadException ex)
     {
         return null;
     }
 }
Exemplo n.º 10
0
 public static Job createJob(System.Guid JobId, String JobName, String CompensationId, System.Guid EmployerId, 
                             String JobDescription, int JobQuota, decimal JobExperienceLevel, decimal JobCompensationValue)
 {
     Job obj = new Job();
     obj.JobId = JobId;
     obj.JobName = JobName;
     obj.CompensationId = CompensationId;
     obj.EmployerId = EmployerId;
     obj.JobDescription = JobDescription;
     obj.JobQuota = JobQuota;
     obj.JobExperienceLevel = JobExperienceLevel;
     obj.JobCompensationValue = JobCompensationValue;
     return obj;
 }