Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
 public void SearchWhere(Fromtorecord theOperation)
 {
     operation = theOperation;
 }