Esempio n. 1
0
        static public bool DeleteHTMLSerial(ObjectId id)
        {
            HTMLSerial serial = GetHTMLSerial(id);
            bool       r      = DeleteHTMLSerial(serial);

            SaveFullHTMLSerial_Deleted(serial);
            return(r);
        }
Esempio n. 2
0
 private static ObjectId SaveFullHTMLSerial_Deleted(HTMLSerial r)
 {
     if (r != null)
     {
         var col = database.GetCollection(CollectionsDeleted.full_serial_deleted.ToString());
         var obj = r;
         WriteConcernResult res = col.Save(obj);
         Global.Log("SaveFullHTMLSerial_Deleted: " + res.UpdatedExisting.ToString());
         return((ObjectId)obj.id);
     }
     else
     {
         return(new ObjectId());
     }
 }
Esempio n. 3
0
        static public bool DeleteHTMLSerial(HTMLSerial html)
        {
            if (html == null)
            {
                throw new ArgumentNullException("HTMLSerial in Database.MongoTB.DeleteMachineRecord is null");
            }

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

            WriteConcernResult result = collection.Remove(Q);

            SaveFullHTMLSerial_Deleted(html);

            return(true);
        }