예제 #1
0
 /// <summary>
 /// 判断 GroupByClip  是否为null
 /// </summary>
 /// <param name="groupByClip"></param>
 /// <returns></returns>
 public static bool IsNullOrEmpty(GroupByOperation groupByClip)
 {
     if ((null == groupByClip) || string.IsNullOrEmpty(groupByClip.ToString()))
     {
         return(true);
     }
     return(false);
 }
예제 #2
0
        /// <summary>
        /// 比较
        /// </summary>
        /// <param name="groupByClip"></param>
        /// <returns></returns>
        public bool Equals(GroupByOperation groupByClip)
        {
            if (null == groupByClip)
            {
                return(false);
            }

            return(this.ToString().Equals(groupByClip.ToString()));
        }
예제 #3
0
        /// <summary>
        /// 去掉的表前缀
        /// </summary>
        /// <returns></returns>
        public GroupByOperation RemovePrefixTableName()
        {
            GroupByOperation groupc = new GroupByOperation(this.groupByClip);

            if (string.IsNullOrEmpty(groupc.groupByClip))
            {
                return(groupc);
            }

            StringBuilder gstring = new StringBuilder();

            string[] fs = groupc.groupByClip.Split(',');
            foreach (string s in fs)
            {
                if (string.IsNullOrEmpty(s))
                {
                    continue;
                }

                gstring.Append(",");
                if (s.IndexOf('.') > 0)
                {
                    gstring.Append(s.Substring(s.IndexOf('.') + 1));
                }
                else
                {
                    gstring.Append(s);
                }
            }

            if (gstring.Length > 1)
            {
                groupc.groupByClip = gstring.ToString().Substring(1);
            }
            else
            {
                groupc.groupByClip = gstring.ToString();
            }

            return(groupc);
        }