Esempio n. 1
0
        /// <summary>
        /// 添加条件
        /// </summary>
        public void AddWhere(string where)
        {
            if (!string.IsNullOrWhiteSpace(where))
            {
                string tmp = where.Trim();

                if (tmp.StartsWith("and", StringComparison.CurrentCultureIgnoreCase))
                {
                    tmp = tmp.Substring(3);
                }
                if (tmp.EndsWith("and", StringComparison.CurrentCultureIgnoreCase))
                {
                    tmp = tmp.Remove(tmp.Length - 3);
                }

                if (!string.IsNullOrWhiteSpace(tmp))
                {
                    Where.AppendFormat("and {0} ", tmp);
                }
            }
        }