• 大小: 647KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-23
  • 语言: C#
  • 标签:

资源简介

C#封装的JqGrid插件,配置相应的即可

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.xml;
using System.Runtime.Serialization.Json;
using System.IO;

namespace AspJqGrid
{
    public class AjaxData : IHttpHandler
    {
        private string searchCase = string.Empty;                     //动态条件

        public void ProcessRequest(HttpContext context)
        {            
            if (context.Request.QueryString[“action“] != null)
            {
                string actions = context.Request.QueryString[“action“].ToString();
                switch (actions)
                {
                    #region 查询
                    case “view“:
                        if (context.Request.QueryString[“_search“].ToString() == “false“)
                        {
                            context.Response.Write(jsonString(context));
                        }                        
                        else
                        {
                            //反序列化json
                            string conditions = HttpUtility.UrlDecode(context.Request.QueryString[“filters“].ToString());
                            var mStream = new MemoryStream(Encoding.UTF8.GetBytes(conditions));     //使用Encoding.Default中文时将会乱码
                            //var mStream = new MemoryStream(Encoding.Unicode.GetBytes(conditions));
                            DataContractJsonSerializer dcjson = new DataContractJsonSerializer(typeof(jqGridFilter));
                            jqGridFilter filters = (jqGridFilter)dcjson.Readobject(mStream);
                            //jqGridFilter filters = (jqGridFilter)dcjson.Readobject(mStream);
                            
                            if (filters.GroupOp == “AND“)
                            {
                                foreach(jqGridFilterRules rules in filters.JqGridFilterRulesList)
                                {
                                    switch (rules.Op)
                                    {
                                        case “cn“:
                                            searchCase += “ and “ + rules.Field + “ like ‘%“ + rules.Data + “%‘“;
                                            break;
                                        case “ge“:
                                            searchCase += “ and “ + rules.Field + “>=‘“ + rules.Data + “‘“;
                                            break;
                                        case “le“:
                                            searchCase += “ and “ + rules.Field + “<=‘“ + rules.Data + “‘“;
                                            break;
                                        default:
                                            break;
                                    }
                                }
                            }
                            else
                            {
       

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      16026  2010-06-07 22:36  AspJqGrid\AspJqGrid\AjaxData.cs

     文件       3387  2010-06-06 23:14  AspJqGrid\AspJqGrid\AspJqGrid.csproj

     文件     256000  2010-06-08 09:21  AspJqGrid\AspJqGrid\bin\Debug\AspJqGrid.dll

     文件      69120  2010-06-08 09:21  AspJqGrid\AspJqGrid\bin\Debug\AspJqGrid.pdb

     文件       9893  2010-06-04 17:14  AspJqGrid\AspJqGrid\bin\Debug\Css\ui.jqgrid.css

     文件       3773  2010-06-06 23:14  AspJqGrid\AspJqGrid\bin\Debug\scripts\grid.locale-cn.js

     文件       3799  2010-06-06 12:34  AspJqGrid\AspJqGrid\bin\Debug\scripts\grid.locale-en.js

     文件     206804  2010-06-04 17:14  AspJqGrid\AspJqGrid\bin\Debug\scripts\jquery.jqGrid.min.js

     文件       9893  2010-06-04 17:14  AspJqGrid\AspJqGrid\Css\ui.jqgrid.css

     文件      11367  2010-06-07 14:18  AspJqGrid\AspJqGrid\jqGrid.cs

     文件       1150  2010-06-05 23:54  AspJqGrid\AspJqGrid\jqGridColumns.cs

     文件       4754  2010-06-07 11:08  AspJqGrid\AspJqGrid\jqGridColumnsConfig.cs

     文件       1451  2010-06-06 22:34  AspJqGrid\AspJqGrid\jqGridFilter.cs

     文件       1074  2010-06-07 22:17  AspJqGrid\AspJqGrid\obj\Debug\AspJqGrid.csproj.FileListAbsolute.txt

     文件     256000  2010-06-08 09:21  AspJqGrid\AspJqGrid\obj\Debug\AspJqGrid.dll

     文件      69120  2010-06-08 09:21  AspJqGrid\AspJqGrid\obj\Debug\AspJqGrid.pdb

     文件       6017  2010-06-08 09:21  AspJqGrid\AspJqGrid\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1683  2010-06-06 23:15  AspJqGrid\AspJqGrid\Properties\AssemblyInfo.cs

     文件       3773  2010-06-06 23:14  AspJqGrid\AspJqGrid\scripts\grid.locale-cn.js

     文件       3799  2010-06-06 12:34  AspJqGrid\AspJqGrid\scripts\grid.locale-en.js

     文件     206804  2010-06-04 17:14  AspJqGrid\AspJqGrid\scripts\jquery.jqGrid.min.js

     文件      20083  2010-06-05 11:57  AspJqGrid\AspJqGrid\SqlHelper.cs

     文件       1398  2010-06-07 11:44  AspJqGrid\AspJqGrid.sln

    ..A..H.     47616  2010-06-09 12:42  AspJqGrid\AspJqGrid.suo

     文件     256000  2010-06-08 09:21  AspJqGrid\WebJqGrid\bin\AspJqGrid.dll

     文件      69120  2010-06-08 09:21  AspJqGrid\WebJqGrid\bin\AspJqGrid.pdb

     文件        180  2010-06-05 11:09  AspJqGrid\WebJqGrid\bin\Css\redmond\images\ui-bg_flat_0_aaaaaa_40x100.png

     文件        182  2010-06-05 11:09  AspJqGrid\WebJqGrid\bin\Css\redmond\images\ui-bg_flat_55_fbec88_40x100.png

     文件        124  2010-06-05 11:09  AspJqGrid\WebJqGrid\bin\Css\redmond\images\ui-bg_glass_75_d0e5f5_1x400.png

     文件        123  2010-06-05 11:09  AspJqGrid\WebJqGrid\bin\Css\redmond\images\ui-bg_glass_85_dfeffc_1x400.png

............此处省略85个文件信息

评论

共有 条评论

相关资源