private int[] CountItem() { var array = new int[18]; var hoSos = _hoSoService.GetAll(); var hops = _hopService.GetAll(); var kes = _keService.GetAll(); var taiLieuVanBans = _taiLieuVanBanService.GetAll(); var den = taiLieuVanBans.Where(p => p.Dang == GlobalConfigs.DANG_DEN).Count(); var di = taiLieuVanBans.Where(p => p.Dang == GlobalConfigs.DANG_DI).Count(); var noiBo = taiLieuVanBans.Where(p => p.Dang == GlobalConfigs.DANG_NOIBO).Count(); array[0] = hoSos.Count(); array[1] = hoSos.Where(p => p.TrangThai == true).Count(); array[2] = hoSos.Where(p => p.TrangThai == false).Count(); array[3] = taiLieuVanBans.Count(); array[4] = taiLieuVanBans.Where(p => p.TrangThai == true).Count(); array[5] = taiLieuVanBans.Where(p => p.TrangThai == false).Count(); array[6] = hops.Count(); array[7] = hops.Where(p => p.TrangThai == true).Count(); array[8] = hops.Where(p => p.TrangThai == false).Count(); array[9] = kes.Count(); array[10] = kes.Where(p => p.TrangThai == true).Count(); array[11] = kes.Where(p => p.TrangThai == false).Count(); array[12] = ComputePercent(taiLieuVanBans.Count(), noiBo); array[13] = ComputePercent(taiLieuVanBans.Count(), den); array[14] = ComputePercent(taiLieuVanBans.Count(), di); array[15] = noiBo; array[16] = den; array[17] = di; return(array); }
private Dictionary <string, List <TaiLieuVanBan> > GetDoc(DateTime?startTime, DateTime?endTime) { var list = new Dictionary <string, List <TaiLieuVanBan> >(); var taiLieuVanBans = _taiLieuVanBanService.GetAll(); if (startTime.HasValue) { taiLieuVanBans = taiLieuVanBans.Where(p => p.NgayTao >= startTime).ToList(); } if (endTime.HasValue) { taiLieuVanBans = taiLieuVanBans.Where(p => p.NgayTao <= endTime).ToList(); } var a = taiLieuVanBans.Where(p => p.Dang == GlobalConfigs.DANG_DEN).ToList(); var b = taiLieuVanBans.Where(p => p.Dang == GlobalConfigs.DANG_DI).ToList(); var c = taiLieuVanBans.Where(p => p.Dang == GlobalConfigs.DANG_NOIBO).ToList(); list.Add(GlobalConfigs.DANG_DEN, a); list.Add(GlobalConfigs.DANG_DI, b); list.Add(GlobalConfigs.DANG_NOIBO, c); return(list); }
public ActionResult KiemTraTrungTen(string vanBan) { var vanBans = _taiLieuVanBanService.GetAll();; var list = new List <TaiLieu_VanBanViewModel>(); foreach (var item in vanBans) { if (vanBan == item.Ten) { list.Add(new TaiLieu_VanBanViewModel { Ten = item.Ten, }); } } return(Json(new { d = list }, JsonRequestBehavior.AllowGet)); }
private MuonTraViewModel GetMuonTra(MuonTra muonTra) { var autoList = AutoCompleteTextHoSos(_taiLieuVanBanService.GetAll()); var chiTietMuonTras = _chiTietMuonTraService.GetAll(); var model = new MuonTraViewModel { Id = muonTra.Id, NgayMuon = muonTra.NgayMuon, NgayCapNhat = muonTra.NgayCapNhat, NgayTra = muonTra.NgayKetThuc, UserId = muonTra.UserId, TinhTrang = muonTra.TinhTrang, TrangThai = muonTra.TrangThai, User = muonTra.User, SoLuong = muonTra.SoLuong, VanThu = muonTra.VanThu, ChiTietMuonTras = chiTietMuonTras, }; return(model); }