Пример #1
0
        // [AbpAuthorize(AppPermissions.Pages_QuanLyNghiPheps_Edit)]
        public async Task <GetQuanLyNghiPhepForEditOutput> GetQuanLyNghiPhepForEdit(EntityDto input)

        {
            var quanLyNghiPhep = await _quanLyNghiPhepRepository.FirstOrDefaultAsync(input.Id);

            //  var output = new GetQuanLyNghiPhepForEditOutput { QuanLyNghiPhep = ObjectMapper.Map<CreateOrEditQuanLyNghiPhepDto>(quanLyNghiPhep) };
            var orgList = await _organizationUnitAppService.GetOrganizationUnits();

            var truongGiaoDichList = _truongGiaoDichRepository.GetAll().ToList();

            var output = new GetQuanLyNghiPhepForEditOutput();

            if (quanLyNghiPhep != null)
            {
                output.LichSuUploadList = await _lichSuUploadsAppService.GetListLichSuUploadDto("NP", quanLyNghiPhep.Id.ToString());

                output.QuanLyTrucTiepList = await _quanLyTrucTiepPNPsAppService.GetListQuanLyTrucTiepDto(quanLyNghiPhep.Id);
            }

            output.OrganizationUnitList = orgList;
            output.QuanLyNghiPhep       = ObjectMapper.Map <CreateOrEditQuanLyNghiPhepDto>(quanLyNghiPhep);


            output.ViTriCongViec = ObjectMapper.Map <List <TruongGiaoDichDto> >(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.VTUT)).OrderBy(x => x.Value));

            // output.TrangThai = ObjectMapper.Map<List<TruongGiaoDichDto>>(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.TRTH)).OrderBy(x => x.Value));

            output.Congty = ObjectMapper.Map <List <TruongGiaoDichDto> >(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.CT)).OrderBy(x => x.Value));
            //output.GioiTinh = ObjectMapper.Map<List<TruongGiaoDichDto>>(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.GT)).OrderBy(x => x.Value));



            return(output);
        }
Пример #2
0
        //[AbpAuthorize(AppPermissions.Pages_HopDongs_Edit)]
        public async Task <GetHopDongForEditOutput> GetHopDongForEdit(EntityDto input)
        {
            var hopDong = await _hopDongRepository.FirstOrDefaultAsync(input.Id);

            var orgList = await _organizationUnitAppService.GetOrganizationUnits();

            var truongGiaoDichList = _truongGiaoDichRepository.GetAll().ToList();

            var output = new GetHopDongForEditOutput();

            if (hopDong != null)
            {
                if (hopDong.tenCTY != null)
                {
                    var templateList = _templateRepository.GetAll()
                                       .Where(x => x.GhiChu.ToUpper().Equals(hopDong.tenCTY.ToUpper()))
                                       .ToList();
                    output.TemplateList = ObjectMapper.Map <List <TemplateDto> >(templateList);
                }
                else
                {
                    output.TemplateList = null;
                }

                output.LichSuUploadList = await _lichSuUploadsAppService.GetListLichSuUploadDto("HD", hopDong.Id.ToString());
            }

            output.OrganizationUnitList = orgList;
            output.HopDong = ObjectMapper.Map <CreateOrEditHopDongDto>(hopDong);


            //output.ViTriCongViec = ObjectMapper.Map<List<OrganizationUnit>>(orgList.Where(x => x.Code).OrderBy(x => x.DisplayName));

            output.TrangThai = ObjectMapper.Map <List <TruongGiaoDichDto> >(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.TRTH)).OrderBy(x => x.Value));

            output.Congty          = ObjectMapper.Map <List <TruongGiaoDichDto> >(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.CT)).OrderBy(x => x.Value));
            output.GioiTinh        = ObjectMapper.Map <List <TruongGiaoDichDto> >(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.GT)).OrderBy(x => x.Value));
            output.HinhThucLamViec = ObjectMapper.Map <List <TruongGiaoDichDto> >(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.HTLV)).OrderBy(x => x.Value));
            output.ThoiHanHopDong  = ObjectMapper.Map <List <TruongGiaoDichDto> >(truongGiaoDichList.Where(x => x.Code.Equals(TruongGiaoDichConsts.THHD)).OrderBy(x => x.Value));
            return(output);
        }