Esempio n. 1
0
        public void SaveToDatabase(IQueryAdapter dbClient)
        {
            WiredUtillity.SaveTriggerItem(dbClient, (int)itemID, "integer", string.Empty, delay.ToString(), false);

            if (dbClient.dbType == Pici.Storage.Database.DatabaseType.MSSQL)
            {
                dbClient.runFastQuery("DELETE FROM trigger_rotation WHERE item_id = " + itemID);
                dbClient.setQuery("INSERT INTO trigger_rotation(item_id,rotation_status,movement_status) VALUES (@id,@rot_id,@mov_id)");
            }
            else
            {
                dbClient.setQuery("REPLACE INTO trigger_rotation SET item_id = @id, rotation_status = @rot_id,  movement_status = @mov_id");
            }
            dbClient.addParameter("id", (int)itemID);
            dbClient.addParameter("rot_id", (int)this.rotation);
            dbClient.addParameter("mov_id", (int)this.movement);
            dbClient.runQuery();

            lock (items)
            {
                dbClient.runFastQuery("DELETE FROM trigger_in_place WHERE original_trigger = '" + this.itemID + "'");
                foreach (RoomItem i in items)
                {
                    WiredUtillity.SaveTrigger(dbClient, (int)itemID, (int)i.Id);
                }
            }
        }
Esempio n. 2
0
 public void SaveToDatabase(IQueryAdapter dbClient)
 {
     lock (items)
     {
         dbClient.runFastQuery("DELETE FROM trigger_in_place WHERE original_trigger = '" + this.item.Id + "'");
         foreach (RoomItem i in items)
         {
             WiredUtillity.SaveTrigger(dbClient, (int)item.Id, (int)i.Id);
         }
     }
 }
Esempio n. 3
0
 public void SaveToDatabase(IQueryAdapter dbClient)
 {
     WiredUtillity.SaveTriggerItem(dbClient, (int)itemID, "integer", string.Empty, delay.ToString(), false);
     lock (items)
     {
         dbClient.runFastQuery("DELETE FROM trigger_in_place WHERE original_trigger = '" + this.itemID + "'");
         foreach (RoomItem i in items)
         {
             WiredUtillity.SaveTrigger(dbClient, (int)itemID, (int)i.Id);
         }
     }
 }
Esempio n. 4
0
 public void SaveToDatabase(IQueryAdapter dbClient)
 {
     WiredUtillity.SaveTriggerItem(dbClient, (int)item.Id, "integer", string.Empty, delay.ToString(), false);
     lock (items)
     {
         dbClient.runFastQuery("DELETE FROM trigger_in_place WHERE original_trigger = '" + this.item.Id + "'");
         foreach (RoomItem i in items)
         {
             WiredUtillity.SaveTrigger(dbClient, (int)item.Id, (int)i.Id);
         }
         //Logging.WriteLine("save trigger 'updatestate' items: " + items.Count);
     }
 }