Пример #1
0
        public GetJobAdvertisementViewModel GetJobAdvertisementDetailByJobAdvertisementId(int Id)
        {
            var model = new GetJobAdvertisementViewModel();
            JobAdvertisement jobAdvertisement = _jobAdvertisementRepository.Get(x => x.Id == Id);

            if (jobAdvertisement != null)
            {
                model.JobAdvertisementId = jobAdvertisement.Id;
                model.CityName           = _cityService.GetCityNameByCityId(jobAdvertisement.CityId);
                model.DepartmantName     = _departmantService.GetDepartmantNameByDepartmantId(jobAdvertisement.DepartmantId);
                model.EducationLevelName = _educationLevelService.GetEdcuationLevelNameByEducationLevelId(jobAdvertisement.EducationLevelId);
                model.PositionName       = _positionService.GetPositionNameByPositionId(jobAdvertisement.PositionId);
                model.WorkTypeName       = _workTypeService.GetWorkTypeNameByWorkTypeId(jobAdvertisement.WorkTypeId);
                model.CompanyName        = _companyDetailService.GetCompanyDetailNameByCompanyUserId(jobAdvertisement.CompanyUserId);
                model.CityId             = jobAdvertisement.CityId;
                model.DepartmantId       = jobAdvertisement.DepartmantId;
                model.EducationLevelId   = jobAdvertisement.EducationLevelId;
                model.PositionId         = jobAdvertisement.PositionId;
                model.WorkTypeId         = jobAdvertisement.WorkTypeId;
                model.CreateDate         = jobAdvertisement.CreateDate;
                model.ExpireDate         = jobAdvertisement.ExpireDate;
                model.JobDefinition      = jobAdvertisement.JobDefinition;
                model.RequiredExperience = jobAdvertisement.RequiredExperience;
                model.CompanyUserId      = jobAdvertisement.CompanyUserId;
                model.AvailableJobCount  = jobAdvertisement.AvailableJobCount;
                model.ViewCount          = GetAdvertisementViewCountByJobAdvertisementId(Id);
                model.JobTitle           = jobAdvertisement.JobTitle;
                //model.isUserApplied = _advertisementApplyService.checkIsUserAppliedByUserId(model.JobAdvertisementId);
                model.isUserApplied = checkIsUserAppliedByUserId(model.JobAdvertisementId);
            }

            return(model);
        }