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)); }
public PartialViewResult Edit(long id = 0) { var viewModel = new TemplateRecruitmentRequestEditViewModel(); var editEntity = recruitmentRequestService.GetById(id) ?? new RecruitmentRequest(); var groupSkillIds = editEntity.SkillGroups.ToListNumber <long>(',').Cast <object>().ToList(); viewModel = new TemplateRecruitmentRequestEditViewModel() { Id = editEntity.Id, Title = editEntity.Title, SkillIds = editEntity.SkillGroups.ToListNumber <long>(',').ToArray(), GroupSkills = recruitmentSkillService.GetDropDownMultiple("Title", "Id", groupSkillIds) }; return(PartialView("_EditPartial", viewModel)); }