Skip to content

Commit a26de0b

Browse files
committed
Revert "coding"
This reverts commit 6a32ad0.
1 parent 6a32ad0 commit a26de0b

File tree

9 files changed

+6094
-5859
lines changed

9 files changed

+6094
-5859
lines changed

.vs/config/applicationhost.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
</site>
164164
<site name="YanZhiwei.JavaScript.Utilities" id="2">
165165
<application path="/" applicationPool="Clr4IntegratedAppPool">
166-
<virtualDirectory path="/" physicalPath="G:\开发\代码\Source\Repos\JavaScript.Utilities\YanZhiwei.JavaScript.Utilities" />
166+
<virtualDirectory path="/" physicalPath="D:\Source\Repos\JavaScript.Utilities\YanZhiwei.JavaScript.Utilities" />
167167
</application>
168168
<bindings>
169169
<binding protocol="http" bindingInformation="*:3408:localhost" />

YanZhiwei.JavaScript.Utilities/BackHandler/BaseHandler.ashx.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Net;
55
using System.Web;
66
using YanZhiwei.DotNet3._5.Utilities.Model;
7-
using YanZhiwei.DotNet3._5.Utilities.WebForm.JqueryPlugin;
7+
using YanZhiwei.DotNet3._5.Utilities.WebForm.Jquery;
88
using YanZhiwei.JavaScript.Utilities.Model;
99

1010
namespace YanZhiwei.JavaScript.Utilities.BackHandler
@@ -16,7 +16,7 @@ public class BaseHandler : IHttpHandler
1616
{
1717
public static IEnumerable<Person> GetPersons()
1818
{
19-
for(int i = 0; i < 57; i++)
19+
for (int i = 0; i < 57; i++)
2020
{
2121
yield return new Person
2222
{
@@ -25,31 +25,28 @@ public static IEnumerable<Person> GetPersons()
2525
};
2626
}
2727
}
28-
28+
2929
public void ProcessRequest(HttpContext context)
3030
{
3131
context.ExecutePageQuery<Person>((pageLength, pageIndex, orderIndex, orderBy) =>
3232
{
3333
var persons = GetPersons();
3434
Func<Person, object> order = p =>
3535
{
36-
if(orderIndex == 0)
36+
if (orderIndex == 0)
3737
{
3838
return p.Id;
3939
}
40-
4140
return p.Name;
4241
};
43-
44-
if("desc" == orderBy)
42+
if ("desc" == orderBy)
4543
{
4644
persons = persons.OrderByDescending(order);
4745
}
4846
else
4947
{
5048
persons = persons.OrderBy(order);
5149
}
52-
5350
//错误测试
5451
//DataTablePageResult result = new DataTablePageResult();
5552
//result.ExecuteMessage = "测试错误";
@@ -68,8 +65,10 @@ public void ProcessRequest(HttpContext context)
6865
// var iDisplayStart = int.Parse(context.Request["iDisplayStart"]);
6966
// var iSortCol = int.Parse(context.Request["iSortCol_0"]);
7067
// var iSortDir = context.Request["sSortDir_0"];
68+
7169
// // Fetch the data from a repository (in my case in-memory)
7270
// var persons = GetPersons();
71+
7372
// // Define an order function based on the iSortCol parameter
7473
// Func<Person, object> order = p =>
7574
// {
@@ -79,6 +78,7 @@ public void ProcessRequest(HttpContext context)
7978
// }
8079
// return p.Name;
8180
// };
81+
8282
// // Define the order direction based on the iSortDir parameter
8383
// if ("desc" == iSortDir)
8484
// {
@@ -88,6 +88,7 @@ public void ProcessRequest(HttpContext context)
8888
// {
8989
// persons = persons.OrderBy(order);
9090
// }
91+
9192
// // prepare an anonymous object for JSON serialization
9293
// var result = new
9394
// {
@@ -97,13 +98,14 @@ public void ProcessRequest(HttpContext context)
9798
// .Skip(iDisplayStart)
9899
// .Take(iDisplayLength)
99100
// };
101+
100102
// //var serializer = new JavaScriptSerializer();
101103
//// var json = SerializationHelper.JsonSerialize(result);// serializer.Serialize(result);
102104
// context.CreateResponse(result, System.Net.HttpStatusCode.OK);
103105
// //context.Response.ContentType = "application/json";
104106
// //context.Response.Write(json);
105107
}
106-
108+
107109
public bool IsReusable
108110
{
109111
get
@@ -112,6 +114,6 @@ public bool IsReusable
112114
}
113115
}
114116
}
115-
116-
117+
118+
117119
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)