Пример #1
0
        public ActionResult Detail(string id)
        {
            var muonTra = _muonTraService.GetHaveJoinUserAndCTMT(m => m.Id == id);

            var model = GetMuonTra(muonTra);

            return(View(model));
        }
        private List <ChiTietMuonTraViewModel> GetChiTietMuonTras(IEnumerable <ChiTietMuonTra> chiTietMuonTra)
        {
            var model = new List <ChiTietMuonTraViewModel>();

            var autoList = AutoCompleteTextHoSos(_taiLieuVanBanService.Gets(p => p.TrangThai == true, p => p.OrderBy(x => x.Ten)).ToList());

            foreach (var item in chiTietMuonTra)
            {
                var muonTras   = _muonTraService.GetHaveJoinUserAndCTMT(m => m.Id == item.MuonTraID);
                var taiLieuVBs = _taiLieuVanBanService.GetHaveJoinCTMT(m => m.Id == item.TaiLieuVanBanId);
                model.Add(new ChiTietMuonTraViewModel
                {
                    Id              = item.Id,
                    MuonTra         = muonTras,
                    MuonTraId       = item.MuonTraID,
                    TaiLieuVanBan   = taiLieuVBs,
                    TaiLieuVanBanId = item.TaiLieuVanBanId,
                    ViTri           = autoList.First().ViTri,
                    TrangThai       = item.TrangThai,
                });
            }
            return(model);
        }