root.cs

来自「用ajax实现」· CS 代码 · 共 45 行

CS
45
字号
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HFSoft.Data.Mappings;
using HFSoft.Data.Expressions;
using HFSoft.Data;
using NorthWind.Entities;
namespace AjaxSearchDataSample.Controllers
{
    public class Root:HFSoft.MVC.ControllerAdapter
    {
        [HFSoft.MVC.FormMapper("~/default.aspx")]
        public void Default()
        {
        }
        [HFSoft.MVC.FormMapper("~/frmorderview.aspx")]
        public void OrderView()
        {
            HFSoft.MVC.IDataViewContext viewcontext = (HFSoft.MVC.IDataViewContext)this.FormContext;
            IExpression exp;
            FieldAdapter[] orderby = null;
            OrderSearch search = viewcontext.BindObject<OrderSearch>();
            exp = search.GetExpression();
            if (viewcontext.OrderField != null && viewcontext.OrderField != string.Empty)
            {
                orderby = new FieldAdapter[]{new FieldAdapter(viewcontext.OrderField, null)};
            }
            Region region = new Region(viewcontext.PageIndex * 10, viewcontext.PageIndex * 10+10);
            viewcontext.DataItems = exp.List<Order_v>(region, orderby);
            viewcontext.PageSize = 10;
            viewcontext.RecordCount = exp.CountOf<Order_v>();
            
           


        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?