Ejemplo n.º 1
0
 public uint Create(DbObject obj)
 {
     return((uint)Context.Connection.Query <int>("INSERT INTO fso_objects (shard_id, owner_id, lot_id, " +
                                                 "dyn_obj_name, type, graphic, value, budget, upgrade_level) " +
                                                 " VALUES (@shard_id, @owner_id, @lot_id, @dyn_obj_name, @type," +
                                                 " @graphic, @value, @budget, @upgrade_level); SELECT LAST_INSERT_ID();"
                                                 , obj).First());
 }
Ejemplo n.º 2
0
 public bool UpdatePersistState(uint id, DbObject obj)
 {
     return(Context.Connection.Execute("UPDATE fso_objects "
                                       + "SET lot_id = @lot_id, "
                                       + "owner_id = @owner_id, "
                                       + "dyn_obj_name = @dyn_obj_name, "
                                       + "graphic = @graphic, "
                                       + "value = @value, "
                                       + "dyn_flags_1 = @dyn_flags_1, "
                                       + "dyn_flags_2 = @dyn_flags_2 "
                                       + "WHERE object_id = @object_id AND (@lot_id IS NULL OR lot_id = @lot_id);", obj) > 0);
 }