/// <summary> /// ¹Ø¼ü´Ê¹ýÂË /// </summary> /// <returns></returns> ArrayList FilterByKeyword() { if (KeyWord == null || KeyWord == "") { return(CategoryList); } ArrayList temp = new ArrayList(); temp = (ArrayList)CategoryList.Clone(); for (int i = temp.Count - 1; i >= 0; i--) { Category ca = null; DepartmenEx da = null; if (temp[i] is Category) { ca = (Category)temp[i]; if (!Like(ca.Name, KeyWord)) { temp.RemoveAt(i); } } else if (temp[i] is DepartmenEx) { da = (DepartmenEx)temp[i]; if (!Like(da.Name, KeyWord)) { temp.RemoveAt(i); } } } return(temp); }
protected void DrawTreeMenu(object current, string prefix) { Category currentCategory = new Category(); DepartmenEx currentDepart = null; if (current is Category) { currentCategory = (Category)current; currentCategory.FullPath = prefix + "<img src=\"/admin/images/filetype/folder.gif\" /> " + currentCategory.Name; if (!CategoryList.Contains(currentCategory)) { CategoryList.Add(currentCategory); } List <Category> temp = CategoryHelper.GetCategoryByParentID(currentCategory.ID); foreach (Category ca in temp) { DrawTreeMenu(ca, prefix + " ©À©¤ "); } } else if (current is Common.PF.Department) { currentDepart = new DepartmenEx(current as Common.PF.Department); currentDepart.FullPath = prefix + "<img src=\"/admin/images/filetype/folder.gif\" /> " + currentDepart.Name; if (!CategoryList.Contains(currentDepart)) { CategoryList.Add(currentDepart); } List <Common.PF.Department> temp = AccountHelper.GetDepartments(siteID, currentDepart.ID, "", new string[] { "ID", "Title", "Description", "State" }); foreach (Common.PF.Department de in temp) { DrawTreeMenu(de, prefix + " ©À©¤ "); } } }