日期:2014-05-20 浏览次数:20992 次
/// <summary> /// 获取产品 /// </summary> /// <param name="manufacturerID">厂商ID,为null时不做查询条件。</param> /// <param name="categoryID">类别ID,为null时不做查询条件。</param> /// <param name="typeID">类型ID,为null时不做查询条件。</param> /// <param name="name">产品名称,模糊匹配。</param> /// <param name="description">描述,模糊匹配。</param> /// <param name="pageSize">页大小</param> /// <param name="pageIndex">页索引</param> /// <returns></returns> public DataTable GetProduct(int? manufacturerID, int? categoryID, int? typeID, string name, string description, int pageSize, int pageIndex) { ...... }
public class QueryProduct { private int? manufacturerID; /// <summary> /// 厂商ID,为null时不做查询条件。 /// </summary> public int? ManufacturerID { get { return manufacturerID; } set { manufacturerID = value; } } private int? categoryID; /// <summary> /// 类别ID,为null时不做查询条件。 /// </summary> public int? CategoryID { get { return categoryID; } set { categoryID = value; } } private int? typeID; /// <summary> /// 类型ID,为null时不做查询条件。 /// </summary> public int? TypeID { get { return typeID; } set { typeID = value; } } private string name; /// <summary> /// 产品名称,模糊匹配。 /// </summary> public string Name { get { return name; } set { name = value; } } private string description; /// <summary> /// 描述,模糊匹配。 /// </summary> public string Description { get { return description; } set { description = value; } } private int pageSize; /// <summary> /// 页大小 /// </summary> public int PageSize { get { return pageSize; } set { pageSize = value; } } private int pageIndex; /// <summary> /// 页索引 /// </summary> public int PageIndex { get { return pageIndex; } set { pageIndex = value; } } }
/// <summary> /// 获取产品 /// </summary> /// <param name="query">查询条件</param> /// <returns></returns> public DataTable GetProduct(QueryProduct query) { ...... }