public bool CreateJobLevel(string name, int levelNum)
        {
            if (!String.IsNullOrEmpty(name))
            {
                JobLevel jobLevel = this.JobLevelRepository.Get(s => s.Name == name).FirstOrDefault();

                if (jobLevel == null)
                {
                    JobLevel newJobLevel = new JobLevel();
                    newJobLevel.Name      = name;
                    newJobLevel.LevelNum  = levelNum;
                    newJobLevel.IsDeleted = false;
                    this.JobLevelRepository.Insert(newJobLevel);
                    this.Save();
                    return(true);
                }
                else if (jobLevel.IsDeleted == true)
                {
                    jobLevel.IsDeleted = false;
                    jobLevel.LevelNum  = levelNum;
                    this.JobLevelRepository.Update(jobLevel);
                    this.Save();

                    return(true);
                }
                return(false);
            }
            return(false);
        }
예제 #2
0
 public JobLevelVM(JobLevel bo)
 {
     this.ID          = bo.ID;
     this.Name        = bo.Name;
     this.Description = bo.Description;
     this.SortCode    = bo.SortCode;
 }
        public bool UpdateJobLevel(string name, int levelNum, int id)
        {
            if (!String.IsNullOrEmpty(name))
            {
                JobLevel jobLevel = this.JobLevelRepository.GetByID(id);

                if (jobLevel != null)
                {
                    IEnumerable <JobLevel> oldJobLevels = this.JobLevelRepository.Get(s => s.Name == name).AsEnumerable();

                    if (oldJobLevels.Count() == 0)
                    {
                        jobLevel.Name     = name;
                        jobLevel.LevelNum = levelNum;
                        this.JobLevelRepository.Update(jobLevel);
                        this.Save();
                        return(true);
                    }
                    else
                    {
                        if (oldJobLevels.ElementAt(0).IsDeleted == true)
                        {
                            oldJobLevels.ElementAt(0).IsDeleted = false;
                            this.JobLevelRepository.Update(oldJobLevels.ElementAt(0));
                            jobLevel.IsDeleted = true;
                            this.JobLevelRepository.Update(jobLevel);
                            this.Save();
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
        public bool CreateJobLevel(string name, int levelNum)
        {
            if (!String.IsNullOrEmpty(name))
            {
                JobLevel jobLevel = this.JobLevelRepository.Get(s => s.Name == name).FirstOrDefault();

                if (jobLevel == null)
                {
                    JobLevel newJobLevel = new JobLevel();
                    newJobLevel.Name = name;
                    newJobLevel.LevelNum = levelNum;
                    newJobLevel.IsDeleted = false;
                    this.JobLevelRepository.Insert(newJobLevel);
                    this.Save();
                    return true;
                }
                else if (jobLevel.IsDeleted == true)
                {
                    jobLevel.IsDeleted = false;
                    jobLevel.LevelNum = levelNum;
                    this.JobLevelRepository.Update(jobLevel);
                    this.Save();

                    return true;
                }
                return false;
            }
            return false;
        }
예제 #5
0
 public void CreateJobLevel(JobLevel jobLevel)
 {
     if (jobLevel == null)
     {
         return;
     }
     this._dataBase.Insert(jobLevel);
 }
예제 #6
0
 public void UpdateJobLevel(JobLevel jobLevel)
 {
     if (jobLevel == null)
     {
         return;
     }
     this._dataBase.Update(jobLevel);
 }
예제 #7
0
        public ActionResult UpdateJobLevel()
        {
            JobLevel jobLevel = RequestArgs <JobLevel>();

            if (jobLevel == null)
            {
                return(RespondResult(false, "参数无效。"));
            }
            _settingsManager.UpdateJobLevel(jobLevel);
            return(RespondResult());
        }
        public bool DeleteJobLevel(int id)
        {
            JobLevel jobLevel = this.JobLevelRepository.GetByID(id);

            if (jobLevel != null)
            {
                jobLevel.IsDeleted = true;
                this.JobLevelRepository.Update(jobLevel);
                this.Save();
                return(true);
            }
            return(false);
        }
예제 #9
0
        public ActionResult CreateJobLevel()
        {
            JobLevel jobLevel = RequestArgs <JobLevel>();

            if (jobLevel == null)
            {
                return(RespondResult(false, "参数无效。"));
            }
            jobLevel.Id = Guid.NewGuid();
            _settingsManager.CreateJobLevel(jobLevel);
            return(RespondDataResult(new
            {
                jobLevel.Id
            }));
        }
예제 #10
0
        public ActionResult CreateOrEdit(Guid id)
        {
            bool isNew = false;
            var  bo    = _Service.GetSingle(id);

            if (bo == null)
            {
                bo    = new JobLevel();
                bo.ID = id;
                isNew = true;
            }
            var boVM   = new JobLevelVM(bo);
            var editor = PageComponentRepository <JobLevelVM> .CreateOrEditDialog(boVM, isNew);

            return(Json(editor));
        }
예제 #11
0
        public ReturnResult <JobLevel> AddNewJobLevel(JobLevel jobLevel)
        {
            var        result       = new ReturnResult <JobLevel>();
            DbProvider db           = new DbProvider();
            string     outCode      = String.Empty;
            string     outMessage   = String.Empty;
            string     totalRecords = String.Empty;

            try
            {
                // Set tên stored procedure
                db.SetQuery("JobLevel_AddNew", CommandType.StoredProcedure)
                .SetParameter("LevelName", SqlDbType.NVarChar, jobLevel.LevelName)
                .SetParameter("Description", SqlDbType.NVarChar, jobLevel.Description)
                .SetParameter("CreatedUser", SqlDbType.NVarChar, jobLevel.CreatedUser)
                .SetParameter("Status", SqlDbType.TinyInt, jobLevel.Status)
                .SetParameter("ErrorCode", SqlDbType.NVarChar, DBNull.Value, 100, ParameterDirection.Output)
                .SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output)
                .ExcuteNonQuery()
                .Complete();


                db.GetOutValue("ErrorCode", out outCode)
                .GetOutValue("ErrorMessage", out outMessage);
                if (outCode != "0" || outCode == "")
                {
                    result.Failed(outCode, outMessage);
                }
                else
                {
                    result.Item         = jobLevel;
                    result.ErrorCode    = "0";
                    result.ErrorMessage = "";
                }
            }
            catch (Exception ex)
            {
                result.Failed("-1", ex.Message);
            }
            return(result);
        }
예제 #12
0
파일: Job.cs 프로젝트: rider02/enburoku
    //コンストラクタ
    public Job(JobName jobname, JobLevel jobLevel, List <Skill> skills, List <JobName> classChangeDestination,
               List <WeaponType> weaponTypes, JobStatusDto statusDto, GrowthRateDto growthRateDto, int move)
    {
        this.jobName = jobname;

        this.jobLevel = jobLevel;

        this.skills = skills;

        this.classChangeDestination = classChangeDestination;

        this.weaponTypes = weaponTypes;

        //ステータス
        this.statusDto = statusDto;

        //成長率補正
        this.growthRateDto = growthRateDto;

        this.move = move;
    }
예제 #13
0
        public ReturnResult <JobLevel> GetJobLevelById(int id)
        {
            DbProvider provider     = new DbProvider();
            var        result       = new ReturnResult <JobLevel>();
            string     outCode      = String.Empty;
            string     outMessage   = String.Empty;
            string     totalRecords = String.Empty;
            JobLevel   item         = new JobLevel();

            try
            {
                provider.SetQuery("JobLevel_GetById", CommandType.StoredProcedure)
                .SetParameter("Id", SqlDbType.Int, id, ParameterDirection.Input)
                .SetParameter("ErrorCode", SqlDbType.NVarChar, DBNull.Value, 100, ParameterDirection.Output)
                .SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output)
                .GetSingle <JobLevel>(out item).Complete();

                provider.GetOutValue("ErrorCode", out outCode)
                .GetOutValue("ErrorMessage", out outMessage);

                if (outCode != "0" || outCode == "")
                {
                    result.ErrorCode    = outCode;
                    result.ErrorMessage = outMessage;
                }
                else
                {
                    result.Item         = item;
                    result.ErrorCode    = outCode;
                    result.ErrorMessage = outMessage;
                }
            }
            catch (Exception ex)
            {
                result.Failed("-1", ex.Message);
            }

            return(result);
        }
예제 #14
0
        public ActionResult Save(JobLevelVM boVM)
        {
            if (ModelState.IsValid)
            {
                var bo = _Service.GetSingle(boVM.ID);
                if (bo == null)
                {
                    bo    = new JobLevel();
                    bo.ID = boVM.ID;
                }

                boVM.MapToBo(bo);
                _Service.AddOrEditAndSave(bo);

                return(Json(PageComponentRepository <JobLevelVM> .SaveOK(true, "1", "")));
            }
            else
            {
                var vItems = new List <ValidatorResult>();
                foreach (var item in ModelState)
                {
                    if (item.Value.Errors != null)
                    {
                        foreach (var vItem in item.Value.Errors)
                        {
                            var errItem = new ValidatorResult();
                            errItem.Name         = item.Key;
                            errItem.ErrorMessage = vItem.ErrorMessage;
                            vItems.Add(errItem);
                        }
                    }
                }

                var editor = PageComponentRepository <JobLevelVM> .UpdateCreateOrEditDialog(boVM, false, vItems).InnerHtmlContent;

                return(Json(editor));
            }
        }
예제 #15
0
        public ReturnResult <JobLevel> DeleteJobLevel(int id)
        {
            DbProvider provider     = new DbProvider();
            var        result       = new ReturnResult <JobLevel>();
            string     outCode      = String.Empty;
            string     outMessage   = String.Empty;
            string     totalRecords = String.Empty;
            JobLevel   item         = new JobLevel();

            try
            {
                provider.SetQuery("JobLevel_Delete", CommandType.StoredProcedure)
                .SetParameter("Id", SqlDbType.Int, id, System.Data.ParameterDirection.Input)
                .SetParameter("ErrorCode", SqlDbType.NVarChar, DBNull.Value, 100, System.Data.ParameterDirection.Output)
                .SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, System.Data.ParameterDirection.Output)
                .ExcuteNonQuery().Complete();

                provider.GetOutValue("ErrorCode", out outCode)
                .GetOutValue("ErrorMessage", out outMessage);

                if (outCode != "0")
                {
                    result.Failed(outCode, outMessage);
                }
                else
                {
                    result.ErrorCode    = "0";
                    result.ErrorMessage = "";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(result);
        }
예제 #16
0
        public ReturnResult <JobLevel> UpdateJobLevel(JobLevel jobLevel)
        {
            ReturnResult <JobLevel> result = new ReturnResult <JobLevel>();;
            DbProvider db;

            try
            {
                db = new DbProvider();
                db.SetQuery("JobLevel_Update", CommandType.StoredProcedure);
                db.SetParameter("JobLevelId", SqlDbType.Int, jobLevel.JobLevelId);
                db.SetParameter("LevelName", SqlDbType.NVarChar, jobLevel.LevelName);
                db.SetParameter("Description", SqlDbType.NVarChar, jobLevel.Description);
                db.SetParameter("ModifiedUser", SqlDbType.NVarChar, jobLevel.ModifiedDate);
                db.SetParameter("Status", SqlDbType.TinyInt, jobLevel.Status);
                db.SetParameter("ErrorCode", SqlDbType.Int, DBNull.Value, ParameterDirection.Output);
                db.SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output);
                db.ExcuteNonQuery();
                db.Complete();
                db.GetOutValue("ErrorCode", out string errorCode);
                db.GetOutValue("ErrorMessage", out string errorMessage);
                if (errorCode.ToString() == "0")
                {
                    result.ErrorCode    = "0";
                    result.ErrorMessage = "";
                }
                else
                {
                    result.Failed(errorCode, errorMessage);
                }
            }
            catch (Exception ex)
            {
                result.Failed("-1", ex.Message);
            }
            return(result);
        }
예제 #17
0
        public int Matching(int profileId, int jobId)
        {
            int matchingPercent = 0;

            Profile profile = this.ProfileRepository.GetByID(profileId);
            Job     job     = this.JobRepository.GetByID(jobId);

            if (profile != null && job != null)
            {
                // MinSalary - MaxSalary Nullable - 20
                decimal expectedSalary = profile.ExpectedSalary;
                decimal?minSalary      = job.MinSalary;
                decimal?maxSalary      = job.MaxSalary;
                if (expectedSalary == 0 ||
                    (minSalary != null && maxSalary != null && minSalary <= expectedSalary && expectedSalary <= maxSalary) ||
                    (minSalary != null && maxSalary == null && minSalary <= expectedSalary) ||
                    (minSalary == null && maxSalary != null && expectedSalary <= maxSalary))
                {
                    matchingPercent += 20;
                }

                // JobLevel_ID - 20
                JobLevel expectedJobLevel = this.JobLevelRepository.GetByID(profile.ExpectedJobLevel_ID);
                JobLevel jobLevel         = this.JobLevelRepository.GetByID(job.JobLevel_ID);
                if (expectedJobLevel != null && jobLevel != null)
                {
                    if (jobLevel.LevelNum >= expectedJobLevel.LevelNum)
                    {
                        matchingPercent += 20;
                    }
                }

                // MinSchoolLevel_ID - 20
                SchoolLevel highestSchoolLevel = this.SchoolLevelRepository.GetByID(profile.HighestSchoolLevel_ID);
                SchoolLevel minSchoolLevel     = this.SchoolLevelRepository.GetByID(job.MinSchoolLevel_ID);
                if (highestSchoolLevel != null && minSchoolLevel != null)
                {
                    if (highestSchoolLevel.LevelNum >= minSchoolLevel.LevelNum)
                    {
                        matchingPercent += 20;
                    }
                }

                // Skill (nhieu TH) - 20
                IEnumerable <int> jobSkillIdList       = this.JobSkillRepository.Get(s => s.JobID == jobId && s.IsDeleted == false).Select(s => s.Skill_ID).AsEnumerable();
                IEnumerable <int> ownSkillIdList       = this.OwnSkillRepository.Get(s => s.JobSeekerID == profile.JobSeekerID && s.IsDeleted == false).Select(s => s.Skill_ID).AsEnumerable();
                IEnumerable <int> skillIdIntersectList = jobSkillIdList.Intersect(ownSkillIdList);
                if (jobSkillIdList.Count() == 0)
                {
                    matchingPercent += 20;
                }
                else if (skillIdIntersectList.Count() > 0)
                {
                    matchingPercent += skillIdIntersectList.Count() * 20 / jobSkillIdList.Count();
                }

                // Benefit (nhieu TH) - 20
                //IEnumerable<int> jobBenefitIdList = this.JobBenefitRepository.Get(s => s.JobID == jobId && s.IsDeleted == false).Select(s => s.BenefitID).AsEnumerable();
                //IEnumerable<int> desiredBenefit = this.DesiredBenefitRepository.Get(s => s.JobSeekerID == profile.JobSeekerID && s.IsDeleted == false).Select(s => s.BenefitID).AsEnumerable();
                //IEnumerable<int> benefitIdIntersectList = jobBenefitIdList.Intersect(desiredBenefit);
                //if (jobBenefitIdList.Count() == 0)
                //{
                //    matchingPercent += 20;
                //}
                //if (benefitIdIntersectList.Count() > 0)
                //{
                //    matchingPercent += benefitIdIntersectList.Count() * 20 / jobBenefitIdList.Count();
                //}

                // Category - 10
                IEnumerable <int> jobCategoryIdList       = this.JobCategoryRepository.Get(s => s.JobID == jobId && s.IsDeleted == false).Select(s => s.CategoryID).AsEnumerable();
                IEnumerable <int> expectedCategoryIdList  = this.ExpectedCategoryRepository.Get(s => s.ProfileID == profileId && s.IsDeleted == false).Select(s => s.CategoryID).AsEnumerable();
                IEnumerable <int> categoryIdIntersectList = jobCategoryIdList.Intersect(expectedCategoryIdList);
                if (categoryIdIntersectList.Count() > 0)
                {
                    matchingPercent += 10;
                }

                // City - 10
                IEnumerable <int> jobCityIdList       = this.JobCityRepository.Get(s => s.JobID == jobId && s.IsDeleted == false).Select(s => s.CityID).AsEnumerable();
                IEnumerable <int> expectedCityIdList  = this.ExpectedCityRepository.Get(s => s.ProfileID == profileId && s.IsDeleted == false).Select(s => s.CityID).AsEnumerable();
                IEnumerable <int> cityIdIntersectList = jobCityIdList.Intersect(expectedCityIdList);
                if (cityIdIntersectList.Count() > 0)
                {
                    matchingPercent += 10;
                }
            }

            return(matchingPercent);
        }
예제 #18
0
 public ReturnResult <JobLevel> AddNewJobLevel(JobLevel jobLevel)
 {
     return(_jobLevelDAL.AddNewJobLevel(jobLevel));
 }
예제 #19
0
 public Employee(string name, JobLevel level, PayType payType)
 {
     this.Name     = name;
     this.JobLevel = level;
     this.PayType  = payType;
 }
예제 #20
0
 public void MapToBo(JobLevel bo)
 {
     bo.Name        = this.Name;
     bo.Description = this.Description;
     bo.SortCode    = this.SortCode;
 }
 public static AuthorizationPolicyBuilder RequireJobLevel(this AuthorizationPolicyBuilder builder, JobLevel level)
 {
     builder.AddRequirements(new JobLevelRequirement(level));
     return builder;
 }
예제 #22
0
 public JobLevelRequirement(JobLevel level)
 {
     Level = level;
 }
예제 #23
0
 public static AuthorizationPolicyBuilder RequireJobLevel(this AuthorizationPolicyBuilder builder, JobLevel level)
 {
     builder.AddRequirements(new JobLevelRequirement(level));
     return(builder);
 }
 public IActionResult UpdateJobLevel(JobLevel jobLevel)
 {
     return(Ok(_jobLevelBUS.UpdateJobLevel(jobLevel)));
 }
 public IActionResult AddNewJobLevel([FromBody] JobLevel jobLevel)
 {
     return(Ok(_jobLevelBUS.AddNewJobLevel(jobLevel)));
 }
예제 #26
0
        public override void Update(UpdateState state)
        {
            base.Update(state);

            if (Opacity < 1)
            {
                if (DynamicOverlay.GetChildren().Count > 0)
                {
                    DynamicOverlay.Remove(PerformanceBar);
                    Add(PerformanceBar);
                }
            }
            else
            {
                if (DynamicOverlay.GetChildren().Count == 0)
                {
                    Remove(PerformanceBar);
                    DynamicOverlay.Add(PerformanceBar);
                }
            }
            var sel = Game.SelectedAvatar;

            if (sel == null)
            {
                return;
            }
            var type        = sel.GetPersonData(FSO.SimAntics.Model.VMPersonDataVariable.JobType);
            var level       = sel.GetPersonData(FSO.SimAntics.Model.VMPersonDataVariable.JobPromotionLevel);
            var performance = sel.GetPersonData(FSO.SimAntics.Model.VMPersonDataVariable.JobPerformance);

            var job = Content.Get().Jobs.GetJob((ushort)type);

            if (job == null)
            {
                if (LastPerformance != -200)
                {
                    JobTitle.Caption         = "Unemployed";
                    SalaryTitle.Caption      = "";
                    PerformanceBar.Visible   = false;
                    PerformanceTitle.Visible = false;

                    LastJobLevel    = null;
                    LastPerformance = -200;
                }
            }
            else
            {
                var myLevel = job.JobLevels[level];

                if (myLevel != LastJobLevel)
                {
                    JobTitle.Caption    = myLevel.JobName;
                    SalaryTitle.Caption = "Salary: §" + myLevel.Salary + " (" + ToTime(myLevel.StartTime) + "-" + ToTime(myLevel.EndTime) + ")";

                    LastJobLevel = myLevel;
                }

                if (LastPerformance != performance)
                {
                    PerformanceBar.Visible     = true;
                    PerformanceTitle.Visible   = true;
                    PerformanceBar.MotiveValue = performance;
                    LastPerformance            = performance;
                }
                for (int i = 0; i < 6; i++)
                {
                    Skills[i].Needed = myLevel.MinRequired[i + 1] / 100;
                }
            }

            for (int i = 0; i < 6; i++)
            {
                Skills[i].Value = sel.GetPersonData(SkillInd[i]) / 100;
            }
        }
 public JobLevelRequirement(JobLevel level)
 {
     Level = level;
 }
예제 #28
0
        public List <SosanhItem> GetMatchingDetail(int profileId, int jobId)
        {
            List <SosanhItem> matchingDetail = new List <SosanhItem>();

            Profile profile = this.ProfileRepository.GetByID(profileId);
            Job     job     = this.JobRepository.GetByID(jobId);

            if (profile != null && job != null)
            {
                int tong = 0;

                // MinSalary - MaxSalary Nullable - 20
                decimal    expectedSalary = profile.ExpectedSalary;
                decimal?   minSalary      = job.MinSalary;
                decimal?   maxSalary      = job.MaxSalary;
                SosanhItem sosanh1        = new SosanhItem();
                sosanh1.columnName = "Mức lương";
                sosanh1.tyle       = 20;
                if (minSalary == null && maxSalary == null)
                {
                    sosanh1.jobInfo = "Thỏa thuận";
                }
                else
                {
                    sosanh1.jobInfo = "$" + String.Format("{0:#.00}", minSalary) + " => $" + String.Format("{0:#.00}", maxSalary);
                }
                if (expectedSalary == 0)
                {
                    sosanh1.applicantInfo = "Thỏa thuận";
                }
                else
                {
                    sosanh1.applicantInfo = "$" + String.Format("{0:#.00}", expectedSalary);
                }
                if (expectedSalary == 0 ||
                    (minSalary != null && maxSalary != null && minSalary <= expectedSalary && expectedSalary <= maxSalary) ||
                    (minSalary != null && maxSalary == null && minSalary <= expectedSalary) ||
                    (minSalary == null && maxSalary != null && expectedSalary <= maxSalary))
                {
                    sosanh1.isSatisfied = true;
                    tong += 20;
                }
                else
                {
                    sosanh1.isSatisfied = false;
                }
                matchingDetail.Add(sosanh1);

                // JobLevel_ID - 20
                JobLevel   expectedJobLevel = this.JobLevelRepository.GetByID(profile.ExpectedJobLevel_ID);
                JobLevel   jobLevel         = this.JobLevelRepository.GetByID(job.JobLevel_ID);
                SosanhItem sosanh2          = new SosanhItem();
                sosanh2.columnName    = "Vị trí";
                sosanh2.tyle          = 20;
                sosanh2.jobInfo       = jobLevel.Name;
                sosanh2.applicantInfo = expectedJobLevel.Name;
                if (expectedJobLevel != null && jobLevel != null)
                {
                    if (jobLevel.LevelNum >= expectedJobLevel.LevelNum)
                    {
                        sosanh2.isSatisfied = true;
                        tong += 20;
                    }
                    else
                    {
                        sosanh2.isSatisfied = false;
                    }
                }
                matchingDetail.Add(sosanh2);

                // MinSchoolLevel_ID - 20
                SchoolLevel highestSchoolLevel = this.SchoolLevelRepository.GetByID(profile.HighestSchoolLevel_ID);
                SchoolLevel minSchoolLevel     = this.SchoolLevelRepository.GetByID(job.MinSchoolLevel_ID);
                SosanhItem  sosanh3            = new SosanhItem();
                sosanh3.columnName    = "Trình độ";
                sosanh3.tyle          = 20;
                sosanh3.jobInfo       = minSchoolLevel.Name;
                sosanh3.applicantInfo = highestSchoolLevel.Name;
                if (highestSchoolLevel != null && minSchoolLevel != null)
                {
                    if (highestSchoolLevel.LevelNum >= minSchoolLevel.LevelNum)
                    {
                        sosanh3.isSatisfied = true;
                        tong += 20;
                    }
                    else
                    {
                        sosanh3.isSatisfied = false;
                    }
                }
                matchingDetail.Add(sosanh3);

                // Skill (nhieu TH) - 20
                IEnumerable <int> jobSkillIdList       = this.JobSkillRepository.Get(s => s.JobID == jobId && s.IsDeleted == false).Select(s => s.Skill_ID).AsEnumerable();
                IEnumerable <int> ownSkillIdList       = this.OwnSkillRepository.Get(s => s.JobSeekerID == profile.JobSeekerID && s.IsDeleted == false).Select(s => s.Skill_ID).AsEnumerable();
                IEnumerable <int> skillIdIntersectList = jobSkillIdList.Intersect(ownSkillIdList);
                SosanhItem        sosanh4 = new SosanhItem();
                sosanh4.columnName = "Kỹ năng";
                sosanh4.tyle       = 20;
                if (jobSkillIdList.Count() == 0)
                {
                    sosanh4.jobInfo = "Không yêu cầu";
                }
                else
                {
                    sosanh4.jobInfo = this.SkillRepository.GetByID(jobSkillIdList.ElementAt(0)).SkillTag;
                    for (int i = 1; i < jobSkillIdList.Count(); i++)
                    {
                        sosanh4.jobInfo += ", " + this.SkillRepository.GetByID(jobSkillIdList.ElementAt(i)).SkillTag;
                    }
                }
                if (ownSkillIdList.Count() == 0)
                {
                    sosanh4.applicantInfo = "Không có";
                }
                else
                {
                    if (jobSkillIdList.Contains(ownSkillIdList.ElementAt(0)))
                    {
                        sosanh4.applicantInfo = this.SkillRepository.GetByID(ownSkillIdList.ElementAt(0)).SkillTag;
                    }
                    else
                    {
                        sosanh4.applicantInfo = "<span style='color: red'>" + this.SkillRepository.GetByID(ownSkillIdList.ElementAt(0)).SkillTag + "</span>";
                    }
                    for (int i = 1; i < ownSkillIdList.Count(); i++)
                    {
                        if (jobSkillIdList.Contains(ownSkillIdList.ElementAt(i)))
                        {
                            sosanh4.applicantInfo += ", " + this.SkillRepository.GetByID(ownSkillIdList.ElementAt(i)).SkillTag;
                        }
                        else
                        {
                            sosanh4.applicantInfo += ", " + "<span style='color: red'>" + this.SkillRepository.GetByID(ownSkillIdList.ElementAt(i)).SkillTag + "</span>";
                        }
                    }
                }
                if (jobSkillIdList.Count() == 0)
                {
                    sosanh4.isSatisfied = true;
                    tong += 20;
                }
                else if (skillIdIntersectList.Count() > 0)
                {
                    sosanh4.isSatisfied = true;
                    tong += skillIdIntersectList.Count() * 20 / jobSkillIdList.Count();
                }
                else
                {
                    sosanh4.isSatisfied = false;
                }
                matchingDetail.Add(sosanh4);

                // Benefit (nhieu TH) - 20
                //IEnumerable<int> jobBenefitIdList = this.JobBenefitRepository.Get(s => s.JobID == jobId && s.IsDeleted == false).Select(s => s.BenefitID).AsEnumerable();
                //IEnumerable<int> desiredBenefit = this.DesiredBenefitRepository.Get(s => s.JobSeekerID == profile.JobSeekerID && s.IsDeleted == false).Select(s => s.BenefitID).AsEnumerable();
                //IEnumerable<int> benefitIdIntersectList = jobBenefitIdList.Intersect(desiredBenefit);
                //SosanhItem sosanh5 = new SosanhItem();
                //sosanh5.columnName = "Phúc lợi";
                //if (jobBenefitIdList.Count() == 0)
                //{
                //    sosanh5.jobInfo = "Không hỗ trợ";
                //}
                //else
                //{
                //    sosanh5.jobInfo = this.BenefitRepository.GetByID(jobBenefitIdList.ElementAt(0)).Name;
                //    for (int i = 1; i < jobBenefitIdList.Count(); i++)
                //    {
                //        sosanh5.jobInfo += ", " + this.BenefitRepository.GetByID(jobBenefitIdList.ElementAt(i)).Name;
                //    }
                //}
                //if (desiredBenefit.Count() == 0)
                //{
                //    sosanh5.applicantInfo = "Không yêu cầu";
                //}
                //else
                //{
                //    sosanh5.applicantInfo = this.BenefitRepository.GetByID(desiredBenefit.ElementAt(0)).Name;
                //    for (int i = 1; i < desiredBenefit.Count(); i++)
                //    {
                //        sosanh5.applicantInfo += ", " + this.BenefitRepository.GetByID(desiredBenefit.ElementAt(i)).Name;
                //    }
                //}
                //if (jobBenefitIdList.Count() == 0 || benefitIdIntersectList.Count() > 0)
                //{
                //    sosanh5.isSatisfied = true;
                //}
                //else
                //{
                //    sosanh5.isSatisfied = false;
                //}
                //matchingDetail.Add(sosanh5);

                // Category - 10
                IEnumerable <int> jobCategoryIdList       = this.JobCategoryRepository.Get(s => s.JobID == jobId && s.IsDeleted == false).Select(s => s.CategoryID).AsEnumerable();
                IEnumerable <int> expectedCategoryIdList  = this.ExpectedCategoryRepository.Get(s => s.ProfileID == profileId && s.IsDeleted == false).Select(s => s.CategoryID).AsEnumerable();
                IEnumerable <int> categoryIdIntersectList = jobCategoryIdList.Intersect(expectedCategoryIdList);
                SosanhItem        sosanh6 = new SosanhItem();
                sosanh6.columnName = "Ngành nghề";
                sosanh6.tyle       = 10;
                if (jobCategoryIdList.Count() == 0)
                {
                    sosanh6.jobInfo = "Không có";
                }
                else
                {
                    sosanh6.jobInfo = this.CategoryRepository.GetByID(jobCategoryIdList.ElementAt(0)).Name;
                    for (int i = 1; i < jobCategoryIdList.Count(); i++)
                    {
                        sosanh6.jobInfo += ", " + this.CategoryRepository.GetByID(jobCategoryIdList.ElementAt(i)).Name;
                    }
                }
                if (expectedCategoryIdList.Count() == 0)
                {
                    sosanh6.applicantInfo = "Không yêu cầu";
                }
                else
                {
                    sosanh6.applicantInfo = this.CategoryRepository.GetByID(expectedCategoryIdList.ElementAt(0)).Name;
                    for (int i = 1; i < expectedCategoryIdList.Count(); i++)
                    {
                        sosanh6.applicantInfo += ", " + this.CategoryRepository.GetByID(expectedCategoryIdList.ElementAt(i)).Name;
                    }
                }
                if (categoryIdIntersectList.Count() > 0)
                {
                    sosanh6.isSatisfied = true;
                    tong += 10;
                }
                else
                {
                    sosanh6.isSatisfied = false;
                }
                matchingDetail.Add(sosanh6);

                // City - 10
                IEnumerable <int> jobCityIdList       = this.JobCityRepository.Get(s => s.JobID == jobId && s.IsDeleted == false).Select(s => s.CityID).AsEnumerable();
                IEnumerable <int> expectedCityIdList  = this.ExpectedCityRepository.Get(s => s.ProfileID == profileId && s.IsDeleted == false).Select(s => s.CityID).AsEnumerable();
                IEnumerable <int> cityIdIntersectList = jobCityIdList.Intersect(expectedCityIdList);
                SosanhItem        sosanh7             = new SosanhItem();
                sosanh7.columnName = "Thành phố";
                sosanh7.tyle       = 10;
                if (jobCityIdList.Count() == 0)
                {
                    sosanh7.jobInfo = "Không có";
                }
                else
                {
                    sosanh7.jobInfo = this.CityRepository.GetByID(jobCityIdList.ElementAt(0)).Name;
                    for (int i = 1; i < jobCityIdList.Count(); i++)
                    {
                        sosanh7.jobInfo += ", " + this.CityRepository.GetByID(jobCityIdList.ElementAt(i)).Name;
                    }
                }
                if (expectedCityIdList.Count() == 0)
                {
                    sosanh7.applicantInfo = "Không có";
                }
                else
                {
                    sosanh7.applicantInfo = this.CityRepository.GetByID(expectedCityIdList.ElementAt(0)).Name;
                    for (int i = 1; i < expectedCityIdList.Count(); i++)
                    {
                        sosanh7.applicantInfo += ", " + this.CityRepository.GetByID(expectedCityIdList.ElementAt(i)).Name;
                    }
                }
                if (cityIdIntersectList.Count() > 0)
                {
                    sosanh7.isSatisfied = true;
                    tong += 10;
                }
                else
                {
                    sosanh7.isSatisfied = false;
                }
                matchingDetail.Add(sosanh7);

                // Tong
                SosanhItem sosanhtong = new SosanhItem();
                sosanhtong.columnName    = "";
                sosanhtong.jobInfo       = "Tổng:";
                sosanhtong.applicantInfo = tong.ToString() + "%";
                sosanhtong.isSatisfied   = true;
                sosanhtong.tyle          = 100;
                matchingDetail.Add(sosanhtong);
            }

            return(matchingDetail);
        }
예제 #29
0
        public SettingRegRespObj AddJobLevel(RegJobLevelObj regObj)
        {
            var response = new SettingRegRespObj
            {
                Status = new APIResponseStatus
                {
                    IsSuccessful = false,
                    Message      = new APIResponseMessage()
                }
            };

            try
            {
                if (regObj.Equals(null))
                {
                    response.Status.Message.FriendlyMessage  = "Error Occurred! Unable to proceed with your request";
                    response.Status.Message.TechnicalMessage = "Registration Object is empty / invalid";
                    return(response);
                }

                if (!EntityValidatorHelper.Validate(regObj, out var valResults))
                {
                    var errorDetail = new StringBuilder();
                    if (!valResults.IsNullOrEmpty())
                    {
                        errorDetail.AppendLine("Following error occurred:");
                        valResults.ForEachx(m => errorDetail.AppendLine(m.ErrorMessage));
                    }

                    else
                    {
                        errorDetail.AppendLine(
                            "Validation error occurred! Please check all supplied parameters and try again");
                    }
                    response.Status.Message.FriendlyMessage  = errorDetail.ToString();
                    response.Status.Message.TechnicalMessage = errorDetail.ToString();
                    response.Status.IsSuccessful             = false;
                    return(response);
                }

                if (!HelperMethods.IsUserValid(regObj.AdminUserId, regObj.SysPathCode,
                                               HelperMethods.getSeniorAccountant(), ref response.Status.Message))
                {
                    return(response);
                }

                if (IsJobLevelDuplicate(regObj.Name, 1, ref response))
                {
                    return(response);
                }

                var jobLevel = new JobLevel
                {
                    Name   = regObj.Name,
                    Status = (ItemStatus)regObj.Status
                };

                var added = _repository.Add(jobLevel);

                _uoWork.SaveChanges();

                if (added.JobLevelId < 1)
                {
                    response.Status.Message.FriendlyMessage =
                        "Error Occurred! Unable to complete your request. Please try again later";
                    response.Status.Message.TechnicalMessage = "Unable to save to database";
                    return(response);
                }
                resetCache();
                response.Status.IsSuccessful = true;
                response.SettingId           = added.JobLevelId;
            }
            catch (DbEntityValidationException ex)
            {
                ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
                response.Status.Message.FriendlyMessage  = "Error Occurred! Please try again later";
                response.Status.Message.TechnicalMessage = "Error: " + ex.GetBaseException().Message;
                response.Status.IsSuccessful             = false;
                return(response);
            }
            catch (Exception ex)
            {
                ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
                response.Status.Message.FriendlyMessage  = "Error Occurred! Please try again later";
                response.Status.Message.TechnicalMessage = "Error: " + ex.GetBaseException().Message;
                response.Status.IsSuccessful             = false;
                return(response);
            }
            return(response);
        }
예제 #30
0
 public ReturnResult <JobLevel> UpdateJobLevel(JobLevel jobLevel)
 {
     return(_jobLevelDAL.UpdateJobLevel(jobLevel));
 }
예제 #31
0
 void InitializeJob()
 {
     currentJob     = Jobs.Unemployed;
     jobSkill       = JobLevel.Unemployed;
     specialization = JobSpecialization.Null;
 }
예제 #32
0
 public Manager(string name, JobLevel level, PayType payType, string department)
     : base(name, level, payType)
 {
     this.Department = department;
 }