HTNResp/Controllers/ControlContentController.cs

(开头部分) 4KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Web.Mvc;
using System.Data.SqlClient;
using HTNResp.Models;
using HTNResp.Codes;

namespace HTNResp.Controllers
{
    [Login,Authority]
    public class ControlContentController : BaseController
    {
        HTNResp.BLL.ControlContent bll = new HTNResp.BLL.ControlContent();
        public override ActionResult Index()
        {
            return View();
        }

        public override ActionResult AjaxList()
        {
            int start = 0;  // 分页起始条目数
            int length = 0; // 分页每页分页数
            string strSql = "";
            start = Convert.ToInt32(Request.Params["start"]);
            length = Convert.ToInt32(Request.Params["length"]);

            StringBuilder sb = new StringBuilder("", 100);
            if (!string.IsNullOrEmpty(Request.Params["Title"]))    //返回值是空,非空执行
            {
                strSql += "Title LIKE'%" + Request.Params["Title"] + "%'";
            }

            if (!string.IsNullOrEmpty(Request.Params["Remark"]))
            {
                if (!string.IsNullOrEmpty(strSql))
                    strSql += " and  Remark LIKE'%" + Request.Params["Remark"] + "%'";
                else
                    strSql += "Remark LIKE'%" + Request.Params["Remark"] + "%'";
            }
            if (!string.IsNullOrEmpty(Request.Params["ControlType"]))
            {
                if (strSql != "")
                    strSql += " and ControlType ='" + Request.Params["ControlType"] + "'";
                else
                    strSql += "ControlType ='" + Request.Params["ControlType"] + "'";
            }
            sb.Append(strSql);

            List<HTNResp.Model.ControlContent> list = bll.DataTableToList(bll.GetListByPage(strSql, "", start + 1, start + length).Tables[0]);
            int total = bll.GetRecordCount("");
            int totalFilter = bll.GetRecordCount(strSql);   //查到的页数

            return this.Json(new
            {
                result = 1,
                data = new
                {
后面还有 71 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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