public static string BuildTreeNodeSearchString(string systemGroupCode, TreeNodeSearchType searchType, string typeColumnName) { string systemGroupFullID = SystemManageDAO.GetSystemGroupFullID(systemGroupCode); switch (searchType) { case TreeNodeSearchType.AllSubNodeIncludeSelf: return(string.Format(" {1} in ( select GroupCode from SystemGroup where FullID like '{0}%' ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.AllSubNodeNotIncludeSelf: return(string.Format(" {1} in ( select GroupCode from SystemGroup where FullID FullCode like '{0}%' and FullID <> {'0'} ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.FirstChildNode: return(string.Format(" {1} in ( select GroupCode from SystemGroup where FullID = '{0}' ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.AllSubLeafNode: return(string.Format(" {1} in ( select GroupCode from SystemGroup c where FullID like '{0}%' and Not Exists ( select * from SystemGroup e where e.ParentCode = c.systemGroupCode ) ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.AllSubNotLeafNode: return(string.Format(" {1} in ( select GroupCode from SystemGroup c where FullID like '{0}%' and Exists ( select * from SystemGroup e where e.ParentCode = c.systemGroupCode ) ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.OnlySelfNode: return(string.Format(" {1} = '{0}' ) ", systemGroupCode, typeColumnName)); } return(""); }
public static string BuildTreeNodeSearchString(string costCode, TreeNodeSearchType searchType) { string cBSFullCode = CBSDAO.GetCBSFullCode(costCode); switch (searchType) { case TreeNodeSearchType.AllSubNodeIncludeSelf: return(string.Format(" costCode in ( select costCode from CBS where FullCode like '{0}%' ) ", cBSFullCode)); case TreeNodeSearchType.AllSubNodeNotIncludeSelf: return(string.Format(" costCode in ( select costCode from CBS where FullCode FullCode like '{0}%' and FullCode <> {'0'} ) ", cBSFullCode)); case TreeNodeSearchType.FirstChildNode: return(string.Format(" CostCode in ( select CostCode from CBS where ParentCode = '{0}' ) ", cBSFullCode)); case TreeNodeSearchType.AllSubLeafNode: return(string.Format(" costCode in ( select costCode from CBS c where FullCode like '{0}%' and Not Exists ( select * from CBS e where e.ParentCode = c.CostCode ) ) ", cBSFullCode)); case TreeNodeSearchType.AllSubNotLeafNode: return(string.Format(" costCode in ( select costCode from CBS c where FullCode like '{0}%' and Exists ( select * from CBS e where e.ParentCode = c.CostCode ) ) ", cBSFullCode)); case TreeNodeSearchType.OnlySelfNode: return(string.Format(" CostCode = '{0}' ) ", costCode)); } return(""); }
public static string BuildTreeNodeSearchString(string wbsCode, TreeNodeSearchType searchType) { string wBSFullCode = WBSDAO.GetWBSFullCode(wbsCode); switch (searchType) { case TreeNodeSearchType.AllSubNodeIncludeSelf: return(string.Format(" wbsCode in ( select wbsCode from Task where FullCode like '{0}%' ) ", wBSFullCode)); case TreeNodeSearchType.AllSubNodeNotIncludeSelf: return(string.Format(" wbsCode in ( select wbsCode from Task where FullCode FullCode like '{0}%' and FullCode <> {'0'} ) ", wBSFullCode)); case TreeNodeSearchType.FirstChildNode: return(string.Format(" wbsCode in ( select wbsCode from Task where ParentCode = '{0}' ) ", wBSFullCode)); case TreeNodeSearchType.AllSubLeafNode: return(string.Format(" wbsCode in ( select wbsCode from Task c where FullCode like '{0}%' and Not Exists ( select * from Task e where e.ParentCode = c.wbsCode ) ) ", wBSFullCode)); case TreeNodeSearchType.AllSubNotLeafNode: return(string.Format(" wbsCode in ( select wbsCode from Task c where FullCode like '{0}%' and Exists ( select * from Task e where e.ParentCode = c.wbsCode ) ) ", wBSFullCode)); case TreeNodeSearchType.OnlySelfNode: return(string.Format(" wbsCode = '{0}' ) ", wbsCode)); } return(""); }