Esempio n. 1
0
        private void getParent(datainfo item)
        {
            string[] arypr = item.pr.Split(';');
            foreach (var tmp in arypr)
            {
                if (tmp.Trim() == "") continue;
                string s = "";
                if ("TD".IndexOf(tmp.Substring(tmp.Length - 1)) >= 0)
                {
                    s = tmp.Substring(0, tmp.Length - 1);
                }
                else
                {
                    s = tmp;
                }

                var parents = from y in fmlSource
                        where y.an == s
                        select y;
                if (parents.Count() > 0)
                {
                    //把找到的在先申请加入到 已经验证成功的号
                    foreach (var parent in parents)
                    {
                        isfml.Add(parent.id);
                        novilidefml.Remove(parent.id);
                    }
                    foreach (var m in parents)
                    {
                        Getfml(m);
                    }
                }
            }
        }
Esempio n. 2
0
 private void getBrothers(datainfo item)
 {
     string[] arypr = item.pr.Split(';');
     foreach (var s in arypr)
     {
         var brothers = from y in fmlSource
                       where y.pr.IndexOf(s) >0 && y.id != item.id
                       select y;
         if (brothers.Count() > 0)
         {
             //把找到的在先申请加入到 已经验证成功的号
             foreach (var brother in brothers)
             {
                 isfml.Add(brother.id);
                 novilidefml.Remove(brother.id);
             }
             foreach (var m in brothers)
             {
                 Getfml(m);
             }
         }
     }
 }
Esempio n. 3
0
 private void Getfml(datainfo item)
 {
     //判断是否已经在验证后的家族列表中,如果已经在,进行下一个
     if (isfml.Contains(item.id)) return;
     //找父亲 判断在先申请是否在这个族里,如果有 找到它 的ID
     getParent(item);
     //找兄弟 判断是否有同样的 在先申请 如果有,则是兄弟,并判断兄弟是否有 父亲;
     getBrothers(item);
 }
Esempio n. 4
0
        public void getRoots(datainfo item)
        {
            if (isfml.Contains(item.id)) return;
            isfml.Add(item.id);
            string[] arypr = item.pr.Split(';');
            foreach (var tmp in arypr)
            {
                if (tmp.Trim() == "") continue;
                string s = "";
                if ("TD".IndexOf(tmp.Substring(tmp.Length - 1)) >= 0)
                {
                    s = tmp.Substring(0, tmp.Length - 1);
                }
                else
                {
                    s = tmp;
                }
                var parents = from y in fmlSource
                              where y.an == s
                              select y;
                if (parents.Count() > 0)
                {

                    //找到父节点,继续往上找
                    foreach (var parent in parents)
                    {
                        getRoots(parent);

                    }
                }
                else
                {
                    var ex = from rt in roots
                             where rt.an == s
                             select rt;
                    if (ex.Count() > 0) continue;
                    roots.Add(new fmlinfo() { an = s, id = -1, pn = "" });
                }
            }
        }