public void StockOutfit(VM vm, VMGLOutfit outfit, VMAsyncStockOutfitCallback callback) { Host.InBackground(() => { if (outfit.owner_id == 0) { callback(false, 0); return; } using (var db = DAFactory.Get) { try { var model = new Database.DA.Outfits.DbOutfit { asset_id = outfit.asset_id, purchase_price = outfit.purchase_price, sale_price = outfit.sale_price, outfit_type = outfit.outfit_type, outfit_source = outfit.outfit_source == VMGLOutfitSource.cas ? Database.DA.Outfits.DbOutfitSource.cas : Database.DA.Outfits.DbOutfitSource.rack }; if (outfit.owner_type == VMGLOutfitOwner.AVATAR) { model.avatar_owner = outfit.owner_id; } else if (outfit.owner_type == VMGLOutfitOwner.OBJECT) { model.object_owner = outfit.owner_id; } var result = db.Outfits.Create(model); callback(result != 0, result); } catch (Exception ex) { callback(false, 0); } } }); }
public void StockOutfit(VM vm, VMGLOutfit outfit, VMAsyncStockOutfitCallback callback) { //todo: local stub? }