📄 customerinfosearch.cs
字号:
using System;
using System.Data;
using bookShop.classLib.dbLib;
namespace bookShop.classLib.dataLayer
{
/// <summary>
/// CustomerInfoSearch 的摘要说明。
/// </summary>
public class CustomerInfoSearch
{
private string customerID;
private string customerName;
public CustomerInfoSearch(string customerID,string customerName)
{
this.customerID=customerID;
this.customerName=customerName;
}
public DataSet Search()
{
DataSetDBConnect ds=new DataSetDBConnect("table");
ds.StrSQL="select * from Customer where ";
int conditionCount=0;
if(customerID!=String.Empty)
{
ds.StrSQL+="CustomerID='"+customerID+"' ";
conditionCount++;
}
if(customerName!=String.Empty)
{
if(conditionCount>0)
ds.StrSQL+="and ";
ds.StrSQL+="CustomerName='"+customerName+"'";
conditionCount++;
}
ds.Do();
ds.Close();
return ds.ObjDataSet;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -