Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     using (var da = new DummyTableTableAdapter())
     {
         dtDummy = da.GetData();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Params["command"] == "get")
     {
         using (var da = new DummyTableTableAdapter())
         {
             var param = BsonSerializer.Deserialize<SearchParams>(Request.Params["param"]);
             var dt = da.GetData();
             data = dt.AsEnumerable()
                 .OrderByField(param.sortField, param.sortDir == "asc")
                 .Skip(param.pageIndex * param.pageSize)
                 .Take(param.pageSize)
                 .ToArray().parsePerson();
             numOfPages = (int)Math.Ceiling((Decimal)((decimal)dt.Count / param.pageSize));
         }
     }
 }