Example #1
0
 public int Delete(BaseItem item)
 {
     if (StringChecker.IsNotEmptyObjectId(item.ID))
     {
         var db    = DataStorage.GetInstance(DBType.MongoDB);
         var query = MongoDBFilterCreator.SearchByObjectId(item.ID);
         db.Remove(item._DbName, item._CollectionName, query);
         ClientBehaviorItem.Save(item, ClientBehaviorItem.BehaviorType.除, SESSION.Current);
     }
     return(0);
 }
Example #2
0
 public int Remove(BaseItem item)
 {
     if (StringChecker.IsNotEmptyObjectId(item.ID))
     {
         var db    = DataStorage.GetInstance(DBType.MongoDB);
         var query = MongoDBFilterCreator.SearchByObjectId(item.ID);
         db.Save3(item._DbName, item._CollectionName, "{StatusCode:" + CONST.APP.Status.除 + ",Status:'" + CONST.APP.Status.GetString(CONST.APP.Status.除) + "'}", query, false);
         ClientBehaviorItem.Save(item, ClientBehaviorItem.BehaviorType.移除, SESSION.Current);
     }
     return(0);
 }