public List<Resume> ResumesRanking()
        {
            try
            {
                var dao = new DaoResume();
                DataTable tableData = dao.GetResumeRecommended();
                var listRankResumes = new List<Resume>();

                if (tableData != null && tableData.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in tableData.Rows)
                    {
                        int rank = 1;
                        rank += JobPosition.JobPositionId == dataRow["JobPositionID"].ToString() ? 1 : 0;
                        rank += WorkType.WorkTypeId == dataRow["WorkTypeID"].ToString() ? 1 : 0;
                        rank += ExperienceLevel.ExperianceLevelId == dataRow["ExperienceLevelID"].ToString() ? 1 : 0;
                        rank += Certificate.CertificateId == dataRow["CertificateID"].ToString() ? 1 : 0;
                        rank += JobIndustries.JobIndutriesId == dataRow["JobIndustryID"].ToString() ? 1 : 0;
                        rank += JobSalaryLevel.JobSalaryLevelId == dataRow["SalaryLevelID"].ToString() ? 1 : 0;
                        switch (dataRow["SkillID"].ToString())
                        {

                            case "1":
                            case "2":
                                rank += 0;
                                break;
                            case "3":
                                rank += 1;
                                break;
                            case "4":
                            case "7":
                            case "8":
                            case "9":
                            case "10":
                                rank += 2;
                                break;
                            case "5":
                            case "6":
                                rank += 3;
                                break;
                            case "11":
                                rank -= 2;
                                break;
                            default: break;
                        }
                        var resume = new Resume(dataRow["ResumeID"].ToString(), rank);
                        resume.SetFullResumeInfo();
                        listRankResumes.Add(resume);
                    }
                }
                return listRankResumes;
            }
            catch (Exception exception)
            {

                Console.Write(exception);
                return null;
            }
        }
Beispiel #2
0
        public List <Resume> ResumesRanking()
        {
            try
            {
                var       dao             = new DaoResume();
                DataTable tableData       = dao.GetResumeRecommended();
                var       listRankResumes = new List <Resume>();

                if (tableData != null && tableData.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in tableData.Rows)
                    {
                        int rank = 1;
                        rank += JobPosition.JobPositionId == dataRow["JobPositionID"].ToString() ? 1 : 0;
                        rank += WorkType.WorkTypeId == dataRow["WorkTypeID"].ToString() ? 1 : 0;
                        rank += ExperienceLevel.ExperianceLevelId == dataRow["ExperienceLevelID"].ToString() ? 1 : 0;
                        rank += Certificate.CertificateId == dataRow["CertificateID"].ToString() ? 1 : 0;
                        rank += JobIndustries.JobIndutriesId == dataRow["JobIndustryID"].ToString() ? 1 : 0;
                        rank += JobSalaryLevel.JobSalaryLevelId == dataRow["SalaryLevelID"].ToString() ? 1 : 0;
                        switch (dataRow["SkillID"].ToString())
                        {
                        case "1":
                        case "2":
                            rank += 0;
                            break;

                        case "3":
                            rank += 1;
                            break;

                        case "4":
                        case "7":
                        case "8":
                        case "9":
                        case "10":
                            rank += 2;
                            break;

                        case "5":
                        case "6":
                            rank += 3;
                            break;

                        case "11":
                            rank -= 2;
                            break;

                        default: break;
                        }
                        var resume = new Resume(dataRow["ResumeID"].ToString(), rank);
                        resume.SetFullResumeInfo();
                        listRankResumes.Add(resume);
                    }
                }
                return(listRankResumes);
            }
            catch (Exception exception)
            {
                Console.Write(exception);
                return(null);
            }
        }