Ejemplo n.º 1
0
 public static RecommendedJobDto createRecommendedJobDTO(RecommendedJob obj)
 {
     RecommendedJobDto task = new RecommendedJobDto();
     task.JobId = obj.JobId;
     task.RecruiteeId = obj.RecruiteeId;
     task.PredictedRankingValue = (double)obj.PredictedRankingValue;
     return task;
 }
Ejemplo n.º 2
0
 public static RecommendedJob createRecommendedJob(Guid JobId, Guid RecruiteeId, decimal PredictedRankingValue)
 {
     RecommendedJob obj = new RecommendedJob();
     obj.JobId = JobId;
     obj.RecruiteeId = RecruiteeId;
     obj.PredictedRankingValue = PredictedRankingValue;
     return obj;
 }
Ejemplo n.º 3
0
 public List<RecommendedJob> selectRecommendedJobByRecruiteeId(RecommendedJob obj)
 {
     try
     {
         IRecommendedJobSvc svc = (IRecommendedJobSvc)this.getService(typeof(IRecommendedJobSvc).Name);
         return svc.selectRecommendedJobByRecruiteeId(obj);
     }
     catch (ServiceLoadException ex)
     {
         return null;
     }
 }
Ejemplo n.º 4
0
 public Boolean deleteRecommendedJob(RecommendedJob obj)
 {
     try
     {
         IRecommendedJobSvc svc = (IRecommendedJobSvc)this.getService(typeof(IRecommendedJobSvc).Name);
         return svc.deleteRecommendedJob(obj);
     }
     catch (ServiceLoadException ex)
     {
         return false;
     }
 }
        public Boolean insertRecommendedJob(RecommendedJob obj)
        {
            using (NewElasticBankContext db = new NewElasticBankContext())
            {
                try
                {
                    db.RecommendedJobs.Add(obj);
                    db.SaveChanges();
                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }

            }
        }
Ejemplo n.º 6
0
 public bool insertRecommenderJob(DataResult avgs)
 {
     try
     {
         bool flag = false;
         RecommendedJobManager mgr = new RecommendedJobManager();
         for (int n = 0; n < avgs.Number_top_jobs; n++)
         {
             RecommendedJob job = new RecommendedJob();
             job.RecruiteeId = new Guid(avgs.User_profile.UserID);
             job.JobId = new Guid(avgs.TopJobNames[n]);
             job.PredictedRankingValue = (decimal)avgs.Mylist.ElementAt(n).PredRecJob;
             flag = mgr.insertRecommendedJob(job);
         }
         return flag;
     }
     catch (Exception ex)
     {
         return false;
     }
 }
        public Boolean deleteRecommendedJob(RecommendedJob obj)
        {
            using (NewElasticBankContext db = new NewElasticBankContext())
            {
                try
                {
                    RecommendedJob rec_job = db.RecommendedJobs.SqlQuery("dbo.SelectRecommendedJobByJobIdAndRecruiteeId @JobId='" + obj.JobId.ToString() + "' @RecruiteeId='" + obj.RecruiteeId.ToString() + "'").Single();

                    if (rec_job != null)
                    {
                        db.RecommendedJobs.Remove(rec_job);
                        #region Database Submission

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

                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }
Ejemplo n.º 8
0
    public List<RecommendedJobDto> selectRecommendedJobByRecruiteeId(Guid RecruiteeId)
    {
        RecommendedJobManager mgr = new RecommendedJobManager();
        RecommendedJob obj = new RecommendedJob();
        obj.RecruiteeId = RecruiteeId;
        List<RecommendedJob> recJobList = mgr.selectRecommendedJobByRecruiteeId(obj);
        List<RecommendedJobDto> dtoList = new List<RecommendedJobDto>();

        foreach (RecommendedJob task in recJobList)
        {
            dtoList.Add(RecommendedJobDto.createRecommendedJobDTO(task));
        }

        return dtoList;
    }
Ejemplo n.º 9
0
 public RecommendedJobDto selectRecommendedJobByJobIdAndRecruiteeId(Guid JobId, Guid RecruiteeId)
 {
     RecommendedJobManager mgr = new RecommendedJobManager();
     RecommendedJob obj = new RecommendedJob();
     obj.JobId = JobId;
     obj.RecruiteeId = RecruiteeId;
     obj = mgr.selectRecommendedJobByJobIdAndRecruiteeId(obj);
     if (obj != null)
     {
         return RecommendedJobDto.createRecommendedJobDTO(obj);
     }
     else
     {
         return null;
     }
 }
Ejemplo n.º 10
0
        public RecommendedJob selectRecommendedJobByJobIdAndRecruiteeId(RecommendedJob obj)
        {
            NewElasticBankContext db = new NewElasticBankContext();

            try
            {
                return db.RecommendedJobs.SqlQuery("dbo.SelectRecommendedJobByJobIdAndRecruiteeId @JobId='" + obj.JobId.ToString() + "', @RecruiteeId='" + obj.RecruiteeId.ToString() + "'").Single();
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Ejemplo n.º 11
0
        public List<RecommendedJob> selectRecommendedJobByRecruiteeId(RecommendedJob obj)
        {
            NewElasticBankContext db = new NewElasticBankContext();

            try
            {
                return db.Database.SqlQuery(typeof(RecommendedJob), "dbo.SelectRecommendedJobByRecruiteeId @RecruiteeId='" + obj.RecruiteeId.ToString() + "'").Cast<RecommendedJob>().ToList();
            }
            catch (Exception ex)
            {
                return null;
            }
        }