//搜索互粉人 protected List <string> GetHuList(string id) { List <string> Hlist = new List <string>(); BLL.atbiao bll = new BLL.atbiao(); List <string> Glist = bll.GetGuanList(id); if (Glist == null) { return(null); } for (int i = 0; i < Glist.Count; i++) { int flag = 0; List <string> BeiList = bll.GetGuanList(Glist[i]); //此人不存在,查下一个 if (BeiList == null) { continue; } for (int j = 0; j < BeiList.Count; j++) { if (BeiList[j] == id) { flag = 1; break; } } if (flag == 1) { Hlist.Add(Glist[i]); } } return(Hlist); }
//搜索关注他的人 protected List <string> WhoGuanHe(string id) { BLL.atbiao bll = new BLL.atbiao(); List <string> Wlist = new List <string>(); List <string> Ilist = bll.GetIdList(); for (int i = 0; i < Ilist.Count; i++) { List <string> Glist = bll.GetGuanList(Ilist[i]); if (Glist == null) { continue; } for (int j = 0; j < Glist.Count; j++) { if (Glist[j] == id) { Wlist.Add(Ilist[i]); break; } } } return(Wlist); }