public ActionResult StatisticAndSearch(string buttonType, InitValueStatictisSearchViewModel model) { switch (buttonType) { case "THONGKE": return(RedirectToRoute(UrlLink.CONGVIEC_THONGKE, new { model.From, model.To })); case "SEARCH": return(RedirectToRoute(UrlLink.CONGVIEC, new { model.From, model.To, model.UserId, Role = (int?)model.VaiTroXuLy, TrangThaiCongViecId = model.TrangThaiCongViecId, model.LinhVucCongViecId, model.NoiDungCongViec, model.SoVanBan, model.NoiDungVanBan, model.CoQuanId })); case "THONGKECONGVIEC": return(RedirectToRoute(UrlLink.CONGVIEC_THONGKE_TONGHOP, model)); } return(View()); }
public ActionResult StatisticAndSearch() { //var items = HoSoCongViecRepository.Statistic(); //get list users belong phongnoivu var users = UserRepository.GetUsersByCoQuanId(TechOfficeConfig.IDENTITY_PHONGNOIVU).Select(x => x.ToDataInfo()); var linhVucs = LinhVucCongViecRepository.GetAll().Select(x => x.ToDataInfo()); var coquan = CoQuanRepository.GetAll().Select(x => x.ToDataInfo()); var trangThaiCongViecs = TrangThaiCongViecRepository.GetAll().Select(x => x.ToDataInfo()); var model = new InitValueStatictisSearchViewModel { From = DateTime.Now.AddMonths(-1), To = DateTime.Now, UserInfoNoiVu = users, LinhVucCongViecInfos = linhVucs, CoQuanInfos = coquan, TrangThaiCongViecInfos = trangThaiCongViecs }; return(View(model)); }
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)); }