Beispiel #1
0
        //add()数据
        public void serch_add_data(string name, Assortment mm)
        {
            Assort muser = serchdata(name);

            Assortmentmessage mserchmassage = muser.mserch;

            mserchmassage.addnewdata(mm, mserchmassage.getmsderchdatanode());
        }
Beispiel #2
0
        // 搜索添加数据专用
        private datanode <Assort> serchnode(string usename, datanode <Assort> mm)
        {
            // Console.Write("循环第{0}次",i1++);

            Char[] ma = usename.ToCharArray();
            if (ma.Length == 0)
            {
                return(mm);
            }
            string                    nameflag = ma[0].ToString();
            datanode <Assort>         ff1      = mm;
            datanode <Assort>         ss       = null;
            List <datanode <Assort> > m1       = mm.getdatakuobject();
            Boolean                   fm       = false;

            if (nameflag.Length != 0)
            {
                for (int i = 0; i < mm.getdataku(); i++)
                {
                    datanode <Assort> m2 = m1.ElementAt(i);

                    if (m2.getname() == nameflag)
                    {
                        fm = true;
                        ss = m2;
                        break;
                    }
                }

                if (fm)
                {
                    nameflag = usename.Substring(1);
                    Console.Write("\ndigui第{0}次", ffff++);
                    return(serchnode(nameflag, ss));
                }
                else
                {
                    Console.Write("\n循环第{0}次", i1++);
                    ss = mm;
                    Assort temp = new Assort();
                    ss.createnode(nameflag, temp, null);
                    // mm.addnode();
                    nameflag = usename.Substring(1);
                    return(serchnode(nameflag, ss.getnextnode()));
                }
                // return ff1;
            }
            else
            {
                return(mm);
            }
        }
Beispiel #3
0
        public Boolean updatenodeT(datanode <Assort> mm, string usename, Assort dd, Object mmm)
        {
            datanode <Assort> mg = serchnode(usename, mm);

            if (mg == null)
            {
                return(false);
            }
            else
            {
                mg.updatanodedata(dd, mmm);
                return(true);
            }
        }
Beispiel #4
0
        public Boolean addnodedata(string usename, Assort f)
        {
            datanode <Assort> mg = serchnode(usename, this.nodeworld);

            if (mg == null)
            {
                return(false);
            }
            else
            {
                mg.setT(f);
                return(true);
            }
        }
Beispiel #5
0
        //搜索返回数据
        public Assortment serch_result(string username, string wordstr)
        {
            Assort muser = serchdata_(username);

            if (muser == null)
            {
                return(null);
            }
            Assortmentmessage mserch = muser.mserch;

            if (mserch == null)
            {
                return(null);
            }

            Assortment mword = mserch.serchofword(mserch.getmsderchdatanode(), wordstr);


            return(mword);
        }