public PartialViewResult Edit(long id = 0)
        {
            var viewModel     = new RecruitmentRequestEditViewModel();
            var editEntity    = recruitmentRequestService.GetById(id) ?? new RecruitmentRequest();
            var groupSkillIds = editEntity.SkillGroups.ToListNumber <long>(',').Cast <object>().ToList();

            viewModel = new RecruitmentRequestEditViewModel()
            {
                Id               = editEntity.Id,
                DepartmentId     = editEntity.DepartmentId.ToString(),
                PositionId       = editEntity.PositionId.ToString(),
                EstimateQuantity = editEntity.EstimateQuantity.ToString(),
                Title            = editEntity.Title,
                Comment          = editEntity.Comment,
                UntilDate        = editEntity.Id > 0 ? editEntity.UntilDate : DateTime.Now,
                SkillIds         = editEntity.SkillGroups.ToListNumber <long>(',').ToArray(),
                GroupDepartments = departmentService.GetDropdown("Name", "Id"),
                GroupPositions   = categoryGroupService.GetDataByCode(NHOM_DANHMUC_CONSTANT.VITRI),
                GroupSkills      = recruitmentSkillService.GetDropDownMultiple("Title", "Id", groupSkillIds),
                GroupTemplate    = recruitmentRequestService.GetAll().Where(x => x.IsTemplate == true)
                                   .GetDropdown("Title", "Id", editEntity.TemplateId),
                TemplateId           = editEntity.TemplateId,
                IsChooseFromTemplate = editEntity.TemplateId != null ? true : false
            };
            return(PartialView("_EditPartial", viewModel));
        }
예제 #2
0
        private List <RecruitmentRequestModel> GetAllRequests(string filterType = "", int filterValue = 0, int page = 1)
        {
            List <RecruitmentRequestModel> rePos   = new List <RecruitmentRequestModel>();
            List <RecruitmentRequestDto>   records = reqService.GetAll(filterType, filterValue, RecordsPerPage, page);

            return(Mapper.Map <List <RecruitmentRequestDto>, List <RecruitmentRequestModel> >(records));
        }