mirror of
https://github.com/bvanroll/cs-oo-project.git
synced 2025-08-29 20:12:40 +00:00
Events added for ploegen.cs (reset json files for next boot)
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Data
|
||||
List<Bet> list = new List<Bet>();
|
||||
try
|
||||
{
|
||||
using (StreamReader file = File.OpenText(@"Data/bets.json"))
|
||||
using (StreamReader file = File.OpenText(@"../../Data/bets.json"))
|
||||
{
|
||||
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
@@ -42,7 +42,7 @@ namespace Data
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamReader file = File.OpenText(@"Data/games.json"))
|
||||
using (StreamReader file = File.OpenText(@"../../Data/games.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
list = (List<Game>)serializer.Deserialize(file, typeof(List<Game>));
|
||||
@@ -61,7 +61,7 @@ namespace Data
|
||||
|
||||
List<Person> list = new List<Person>();
|
||||
try {
|
||||
using (StreamReader file = File.OpenText(@"Data/persons.json"))
|
||||
using (StreamReader file = File.OpenText(@"../../Data/persons.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
list = (List<Person>)serializer.Deserialize(file, typeof(List<Person>));
|
||||
@@ -80,7 +80,7 @@ namespace Data
|
||||
List<Ploeg> list = new List<Ploeg>();
|
||||
try
|
||||
{
|
||||
using (StreamReader file = File.OpenText(@"Data/ploegen.json"))
|
||||
using (StreamReader file = File.OpenText(@"../../Data/ploegen.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
list = (List<Ploeg>)serializer.Deserialize(file, typeof(List<Ploeg>));
|
||||
@@ -96,7 +96,7 @@ namespace Data
|
||||
|
||||
public void saveBets(List<Bet> b)
|
||||
{
|
||||
using (StreamWriter file = File.CreateText(@"Data/bets.json"))
|
||||
using (StreamWriter file = File.CreateText(@"../../Data/bets.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
serializer.Serialize(file, b);
|
||||
@@ -105,7 +105,7 @@ namespace Data
|
||||
|
||||
public void saveGames(List<Game> g)
|
||||
{
|
||||
using (StreamWriter file = File.CreateText(@"Data/games.json"))
|
||||
using (StreamWriter file = File.CreateText(@"../../Data/games.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
serializer.Serialize(file, g);
|
||||
@@ -114,7 +114,7 @@ namespace Data
|
||||
|
||||
public void savePersons(List<Person> p)
|
||||
{
|
||||
using (StreamWriter file = File.CreateText(@"Data/persons.json"))
|
||||
using (StreamWriter file = File.CreateText(@"../../Data/persons.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
serializer.Serialize(file, p);
|
||||
@@ -123,7 +123,7 @@ namespace Data
|
||||
|
||||
public void savePloegen(List<Ploeg> p)
|
||||
{
|
||||
using (StreamWriter file = File.CreateText(@"Data/ploegen.json"))
|
||||
using (StreamWriter file = File.CreateText(@"../../Data/ploegen.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
serializer.Serialize(file, p);
|
||||
|
Reference in New Issue
Block a user