Exemplo n.º 1
0
 //toevoegen
 public static int AddPlayerInventoryItem(Inventory_Item inventoryitem)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Inventory_Item.Add(inventoryitem);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 2
0
 //toevoegen
 public static int AddInventory(Inventory inventory)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Inventory.Add(inventory);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 3
0
 //toevoegen
 public static int AddServer(Server server)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Server.Add(server);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 4
0
 //Update inventoryitems
 public static int UpdateInventoryItem(Inventory_Item invItem)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Entry(invItem).State = EntityState.Modified;
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 5
0
 /*=====================
 * Recipes
 *  =====================*/
 //toevoegen
 public static int AddPlayerRecipe(Player_Recipe playerrecipe)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Player_Recipe.Add(playerrecipe);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 6
0
 //Update
 public static int UpdatePlayerRecipe(Player_Recipe recipe)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Entry(recipe).State = EntityState.Modified;
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 7
0
 /*=====================
 * Advancement
 *  =====================*/
 //toevoegen
 public static int AddPlayerAdvancement(Player_Advancement player_advancement)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Player_Advancement.Add(player_advancement);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 8
0
 /*=====================
 * WorldSetting
 *  =====================*/
 //toevoegen
 public static int AddWorldSetting(World_Setting world_setting)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.World_Setting.Add(world_setting);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 9
0
 //toevoegen
 public static int AddPlayer(Player player)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Player.Add(player);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 10
0
 //updaten
 public static int UpdateSpeler(Player player)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Entry(player).State = EntityState.Modified;
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 11
0
 /*=====================
 * Dimension
 *  =====================*/
 //toevoegen
 public static int AddDimension(Dimension dimension)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Dimension.Add(dimension);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 12
0
 //Updaten
 public static int UpdateWorldSetting(World_Setting worldsetting)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Entry(worldsetting).State = EntityState.Modified;
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 13
0
 //verwijderen
 public static int RemoveWorldSetting(World_Setting world_setting)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Entry(world_setting).State = EntityState.Deleted;
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 14
0
 //updaten
 public static int UpdateServer(Server server)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Entry(server).State = EntityState.Modified;
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 15
0
 //Update
 public static int UpdatePlayerAdvancement(Player_Advancement advancement)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.Entry(advancement).State = EntityState.Modified;
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 16
0
 //toevoegen
 public static int AddWorld(World world)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         entities.World.Add(world);
         return(entities.SaveChanges());
     }
 }
Exemplo n.º 17
0
 //verwijderen
 public static int RemoveServer(Server server)
 {
     using (MinecraftEntities entities = new MinecraftEntities())
     {
         var query = entities.Server
                     .Include(x => x.World)
                     .Where(x => x.id == server.id)
                     .SingleOrDefault();
         entities.World.Remove(query.World);
         entities.Server.Remove(query);
         return(entities.SaveChanges());
     }
 }