public ActionResult List(int? id) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; switch (sitemaster["isadmin"]) { case "2": case "3": case "4": int PageNo = id ?? 1; string username = CurrentUserInfo.UserName; int userid = CRMMapper.Get().QueryForObject<int>("EmployeeInfo.GetEmpID", username); Hashtable htparm = new Hashtable(); Hashtable htparmforViewCounts = new Hashtable(); htparm["CretorUserID"] = userid; htparm["start"] = PageSizeList * (PageNo - 1) + 1; //记录开始数 htparm["end"] = PageNo * PageSizeList; //记录结束数 IList<IDictionary> bidAnounceList = CRMMapper.Get().QueryForList<IDictionary>("OrderInfo.GetUserOrder", htparm); int count = CRMMapper.Get().QueryForObject<int>("OrderInfo.GetUserOrderCount", htparm); foreach (IDictionary i in bidAnounceList) { int memberuserid = Int32.Parse(i["MemberUserID"].ToString()); i["MemberUserID"] = MembershipService.GetUserName(Int32.Parse(i["MemberUserID"].ToString())); i["MemberLevel"] = (EnumUserMemberLevel)i["Memberlevel"]; i["CretorUserID"] = CRMMapper.Get().QueryForObject<string>("EmployeeInfo.GetName", userid); htparmforViewCounts["UserID"] = memberuserid; i["ViewCounts"] = CRMMapper.Get().QueryForObject<int>("UserLogin.UserActionCount", htparmforViewCounts); } Comparison<IDictionary> c = new Comparison<IDictionary>(CompareByViewCounts); PagedList<IDictionary> list = new PagedList<IDictionary>(bidAnounceList, PageNo, PageSizeList, count); list.Sort(c); ViewData["ProvincebidAnounceListByUser"] = list; ViewData["Count"] = count; return View(list); default: return RedirectToAction("MemberLevelError", "Base"); } //return View(); }