Пример #1
0
        static public bool DeleteHTMLCounter(ObjectId id)
        {
            HTMLCounter counter = GetHTMLCounter(id);
            bool        r       = DeleteHTMLCounter(counter);

            SaveFullHTMLCounter_Deleted(counter);
            return(r);
        }
Пример #2
0
 private static ObjectId SaveFullHTMLCounter_Deleted(HTMLCounter r)
 {
     if (r != null)
     {
         var col = database.GetCollection(CollectionsDeleted.full_counter_deleted.ToString());
         var obj = r;
         WriteConcernResult res = col.Save(obj);
         Global.Log("SaveFullHTMLCounter_Deleted: " + res.UpdatedExisting.ToString());
         return((ObjectId)obj.id);
     }
     else
     {
         return(new ObjectId());
     }
 }
Пример #3
0
        static public bool DeleteHTMLCounter(HTMLCounter html)
        {
            if (html == null)
            {
                throw new ArgumentNullException("HTMLSerial in Database.MongoTB.DeleteMachineRecord is null");
            }

            var collection = database.GetCollection <HTMLCounter>(Collections.full_counter.ToString());
            var Q          = Query <HTMLCounter> .EQ(e => e.id, html.id);

            WriteConcernResult result = collection.Remove(Q);

            SaveFullHTMLCounter_Deleted(html);

            return(true);
        }