Ejemplo n.º 1
0
    public static string getTreeSql_all(string where1)
    {
        string wherea = "";

        if (where1.Replace(@"|", "") == "")
        {
            wherea = " and 1=1";
        }
        else
        {
            where1 = ReplaceStr.Replace(where1);
            string[] LvArray = where1.Split('|');//级别分割,9级
            wherea = wherea + " and(";
            for (int i = 0; i < LvArray.Length; i++)//循环每级
            {
                if (LvArray[i].Length > 0)
                {
                    wherea = wherea + GetLevelInfo.getLevelSelect(LvArray[i]) + " or ";
                }
            }
            if (where1.Length > 3)
            {
                wherea = wherea.Substring(0, wherea.Length - 3) + ")";
            }
        }

        return wherea;
    }