Esempio n. 1
0
        private IPagedList <HoSoCongViecResult> SearchAll(ValueSearchViewModel model)
        {
            var query = HoSoCongViecRepository.Find(model.ToValueSearch());

            query.ToList().ForEach(x =>
            {
                var folderCongViec = EnsureFolderCongViec(x.Id);
                x.JsonFiles        = GetPathFiles(folderCongViec);
            });
            return(query.ToPagedList(model.Page, TechOfficeConfig.PAGESIZE));
        }
Esempio n. 2
0
        public ActionResult Summaries(InitValueStatictisSearchViewModel model)
        {
            var finds = HoSoCongViecRepository.Find(new ValueSearchCongViec
            {
                From = model.From,
                To   = model.To,
                LinhVucCongViecId = model.LinhVucCongViecId,
                NoiDungCongViec   = model.NoiDungCongViec,
                NoiDungVanBan     = model.NoiDungVanBan,
                Role                = model.VaiTroXuLy,
                SoVanBan            = model.SoVanBan,
                TrangThaiCongViecId = model.TrangThaiCongViecId,
                NhanVienId          = model.UserId,
                CoQuanId            = model.CoQuanId
            });

            var results = new List <SummariesCongViecResult>();

            if (finds != null && finds.Any())
            {
                finds.ToList().ForEach(x =>
                {
                    results.Add(new SummariesCongViecResult
                    {
                        NgayTao    = x.NgayTao.ToString("dd/MM/yyyy"),
                        NgayHetHan = x.NgayHetHan?.ToString("dd/MM/yyyy"),
                        LinhVuc    = x.LinhVucCongViec.Name,
                        XuLyChinh  = x.UserXyLy.HoVaTen,
                        PhuTrach   = x.UserPhuTrach.HoVaTen,
                        TrangThai  = x.TrangThaiCongViecInfo.IfNotNull(y => y.Name),
                        PhoiHop    = x.CongViecPhoiHopResult
                                     .Select(y => y.UserInfo != null ? y.UserInfo.HoVaTen : string.Empty).ToAggregate()
                    });
                });
            }

            return(View(results));
        }