Skip to content

Commit 6a32ad0

Browse files
committed
coding
1 parent 8209a86 commit 6a32ad0

File tree

9 files changed

+5580
-5815
lines changed

9 files changed

+5580
-5815
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="D:\Source\Repos\JavaScript.Utilities\YanZhiwei.JavaScript.Utilities" />
166+
<virtualDirectory path="/" physicalPath="G:\开发\代码\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: 11 additions & 13 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.Jquery;
7+
using YanZhiwei.DotNet3._5.Utilities.WebForm.JqueryPlugin;
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,28 +25,31 @@ 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+
4041
return p.Name;
4142
};
42-
if ("desc" == orderBy)
43+
44+
if("desc" == orderBy)
4345
{
4446
persons = persons.OrderByDescending(order);
4547
}
4648
else
4749
{
4850
persons = persons.OrderBy(order);
4951
}
52+
5053
//错误测试
5154
//DataTablePageResult result = new DataTablePageResult();
5255
//result.ExecuteMessage = "测试错误";
@@ -65,10 +68,8 @@ public void ProcessRequest(HttpContext context)
6568
// var iDisplayStart = int.Parse(context.Request["iDisplayStart"]);
6669
// var iSortCol = int.Parse(context.Request["iSortCol_0"]);
6770
// var iSortDir = context.Request["sSortDir_0"];
68-
6971
// // Fetch the data from a repository (in my case in-memory)
7072
// var persons = GetPersons();
71-
7273
// // Define an order function based on the iSortCol parameter
7374
// Func<Person, object> order = p =>
7475
// {
@@ -78,7 +79,6 @@ public void ProcessRequest(HttpContext context)
7879
// }
7980
// return p.Name;
8081
// };
81-
8282
// // Define the order direction based on the iSortDir parameter
8383
// if ("desc" == iSortDir)
8484
// {
@@ -88,7 +88,6 @@ public void ProcessRequest(HttpContext context)
8888
// {
8989
// persons = persons.OrderBy(order);
9090
// }
91-
9291
// // prepare an anonymous object for JSON serialization
9392
// var result = new
9493
// {
@@ -98,14 +97,13 @@ public void ProcessRequest(HttpContext context)
9897
// .Skip(iDisplayStart)
9998
// .Take(iDisplayLength)
10099
// };
101-
102100
// //var serializer = new JavaScriptSerializer();
103101
//// var json = SerializationHelper.JsonSerialize(result);// serializer.Serialize(result);
104102
// context.CreateResponse(result, System.Net.HttpStatusCode.OK);
105103
// //context.Response.ContentType = "application/json";
106104
// //context.Response.Write(json);
107105
}
108-
106+
109107
public bool IsReusable
110108
{
111109
get
@@ -114,6 +112,6 @@ public bool IsReusable
114112
}
115113
}
116114
}
117-
118-
115+
116+
119117
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)