⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ordersearch.cs

📁 用ajax实现
💻 CS
字号:
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 NorthWind.Entities;
namespace AjaxSearchDataSample.Controllers
{
    public class OrderSearch:ISearch    
    {
        private string mCompanyName;
        public string CompanyName
        {
            get
            {
                return mCompanyName;
            }
            set
            {
                mCompanyName = value;
            }
        }

        private string mShipCity;
        public string ShipCity
        {
            get
            {
                return mShipCity;
            }
            set
            {
                mShipCity = value;
            }
        }

        private DateTime mOrderDate_Begin;
        public DateTime OrderDate_Begin
        {
            get
            {
                return mOrderDate_Begin;
            }
            set
            {
                mOrderDate_Begin = value;
            }
        }

        private DateTime mOrderDate_End;
        public DateTime OrderDate_End
        {
            get
            {
                return mOrderDate_End;
            }
            set
            {
                mOrderDate_End = value;
            }
        }
        #region ISearch 成员

        public HFSoft.Data.Expressions.IExpression GetExpression()
        {
            HFSoft.Data.Expressions.Expression exp = new HFSoft.Data.Expressions.Expression();
            if (CompanyName != null)
                exp &= DBMapping.Customers.CompanyName.Match(CompanyName);
            if (ShipCity != null)
                exp &= DBMapping.Orders.ShipCity.Match(ShipCity);
            if (OrderDate_Begin != DateTime.MinValue)
                exp &= DBMapping.Orders.OrderDate >= OrderDate_Begin;
            if (OrderDate_End != DateTime.MinValue)
                exp &= DBMapping.Orders.OrderDate <=OrderDate_Begin;
            return exp;
        }

        #endregion
    }
}

⌨️ 快捷键说明

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