/// <summary> /// 构建搜索条件 /// </summary> /// <param name="p"></param> /// <returns></returns> private string AppendWhere(object p) { string sqlWhere = " 1=1 "; if (p != null) { Fromtorecord obj = p as Fromtorecord; sqlWhere += string.IsNullOrEmpty(obj.stockBinFrom) ? "" : " AND stockBinFrom = '" + obj.stockBinFrom + "'"; sqlWhere += string.IsNullOrEmpty(obj.matnr) ? "" : " AND matnr LIKE '%" + obj.matnr + "%'"; sqlWhere += string.IsNullOrEmpty(obj.linePoint) ? "" : " AND linePoint LIKE '%" + obj.linePoint + "%'"; sqlWhere += string.IsNullOrEmpty(obj.assLine) ? "" : " AND assLine LIKE '%" + obj.assLine + "%'"; sqlWhere += string.IsNullOrEmpty(obj.StartTime) ? "" : " AND insertTime>=" + obj.StartTime; sqlWhere += string.IsNullOrEmpty(obj.EndTime) ? "" : " AND insertTime<=" + obj.EndTime; } return(sqlWhere); }
public void SearchWhere(Fromtorecord theOperation) { operation = theOperation; }