WebUI/AchieveManageWeb/Controllers/MyTestController.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using AchieveEntity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Text;
using System.Transactions;
using System.Web;
using System.Web.Mvc;
using Webdiyer.WebControls.Mvc;

namespace AchieveManageWeb.Controllers
{
    /// <summary>
    /// 测试控制器
    /// </summary>
    public class MyTestController : Controller
    {
        /// <summary>
        /// 缓存测试
        /// </summary>
        /// <returns></returns>
        [OutputCache(Duration = 10)]
        public ActionResult Index()
        {
            ViewBag.CurrentTime = DateTime.Now;
            return View();
        }

        /// <summary>
        /// 同步分页测试
        /// </summary>
        /// <param name="id">pageIndex</param>
        /// <param name="key">关键字</param>
        /// <returns></returns>
        public ActionResult MVCPager(int? id = 1, string key = null)
        {
            int totalCount = 0;
            int pageIndex = id ?? 1;
            int pageSize = 5;
            List<ArticleEntity> infoList = new AchieveDAL.MyTestDAL().GetArticleList(key, pageSize, (pageIndex - 1) * pageSize, out totalCount);
            PagedList<ArticleEntity> InfoPager = infoList.AsQueryable().OrderByDescending(o => o.ID).ToPagedList(pageIndex, pageSize);
            InfoPager.TotalItemCount = totalCount;
            InfoPager.CurrentPageIndex = (int)(id ?? 1);
            Session["pager_totalcount"] = totalCount;
            //数据组装到viewModel
            Models.MyTest.MVCPager model = new Models.MyTest.MVCPager();
            model.Articles = InfoPager;
            return View(model);
        }

        /// <summary>
        /// 异步分页测试
        /// </summary>
        /// <param name="id">pageIndex</param>
        /// <param name="key">关键字</param>
        /// <returns></returns>
        public ActionResult AjaxPaging(int? id = 1, string key = null)
后面还有 135 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。