Beispiel #1
0
 private static void recountTagDatas(List <Tag> tags)
 {
     foreach (Tag tag in tags)
     {
         int count = DataTagShip.find("Tag.Id=" + tag.Id).count();
         tag.DataCount = count;
         tag.update("DataCount");
     }
 }
Beispiel #2
0
        private static void clearDataTags(IAppData data)
        {
            List <DataTagShip> list = DataTagShip.find("DataId=:dataId and TypeFullName=:dataType")
                                      .set("dataId", data.Id)
                                      .set("dataType", data.GetType().FullName)
                                      .list();

            foreach (DataTagShip ship in list)
            {
                db.delete(ship);
            }
        }
Beispiel #3
0
        private void initDataTagList()
        {
            List <DataTagShip> list = DataTagShip.find("DataId=" + _data.Id + " and TypeFullName=:tname order by Id").set("tname", _data.GetType().FullName).list();

            _dataTags = list;

            _tags = new List <Tag>();
            foreach (DataTagShip dt in list)
            {
                _tags.Add(dt.Tag);
            }
        }
Beispiel #4
0
 private static void joinTag_Data(Tag tag, IAppData data)
 {
     if (DataTagShip.find("DataId=:dataId and Tag.Id=:tagId and TypeFullName=:dataType")
         .set("dataId", data.Id)
         .set("tagId", tag.Id)
         .set("dataType", data.GetType().FullName)
         .count() == 0)
     {
         DataTagShip ship = new DataTagShip();
         ship.DataId       = data.Id;
         ship.TypeFullName = data.GetType().FullName;
         ship.Tag          = tag;
         db.insert(ship);
     }
 }