mirror of
https://github.com/bvanroll/cs-oo-project.git
synced 2025-08-30 04:22:42 +00:00
voila
This commit is contained in:
278
Blok2 Online Gokkantoor/LogicLayer/General.cs
Normal file
278
Blok2 Online Gokkantoor/LogicLayer/General.cs
Normal file
@@ -0,0 +1,278 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using DataLaag;
|
||||
using DataLaag.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
using static DataLaag.Enums;
|
||||
|
||||
namespace LogicLayer
|
||||
{
|
||||
public class General
|
||||
{
|
||||
public List<Wedstrijden> wedstrijden { get; set; }
|
||||
public List<Persoon> personen { get; set; }
|
||||
public List<Keuze> keuzes { get; set; }
|
||||
private Dictionary<int, Persoon> personenMetId;
|
||||
public General()
|
||||
{
|
||||
wedstrijden = new List<Wedstrijden>();
|
||||
try
|
||||
{
|
||||
personen = new List<Persoon>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("" + ex);
|
||||
}
|
||||
try
|
||||
{
|
||||
keuzes = new List<Keuze>();
|
||||
}catch (Exception e)
|
||||
{
|
||||
throw new Exception("" + e);
|
||||
}
|
||||
Deserialize();
|
||||
}
|
||||
|
||||
public void Deserialize()
|
||||
{
|
||||
using (StreamReader file = File.OpenText(@Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName+"/DataLaag/Gegevens/Personen.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
personen = (List<Persoon>)serializer.Deserialize(file, typeof(List<Persoon>));
|
||||
|
||||
}
|
||||
using (StreamReader file = File.OpenText(@Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "/DataLaag/Gegevens/Wedstrijden.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
wedstrijden = (List<Wedstrijden>)serializer.Deserialize(file, typeof(List<Wedstrijden>));
|
||||
}
|
||||
using (StreamReader file = File.OpenText(@Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "/DataLaag/Gegevens/Keuzes.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
keuzes = (List<Keuze>)serializer.Deserialize(file, typeof(List<Keuze>));
|
||||
}
|
||||
wedstrijden = (wedstrijden == null) ? new List<Wedstrijden>() : wedstrijden;
|
||||
personen = (personen == null) ? new List<Persoon>() : personen;
|
||||
keuzes = (keuzes == null) ? new List<Keuze>() : keuzes;
|
||||
FixDictonary();
|
||||
|
||||
}
|
||||
public void Serialize()
|
||||
{
|
||||
using (StreamWriter file = File.CreateText(@Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "/DataLaag/Gegevens/Keuzes.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
serializer.Serialize(file, keuzes);
|
||||
}
|
||||
using (StreamWriter file = File.CreateText(@Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "/DataLaag/Gegevens/Personen.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
serializer.Serialize(file, personen);
|
||||
}
|
||||
using (StreamWriter file = File.CreateText(@Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "/DataLaag/Gegevens/Wedstrijden.json"))
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
serializer.Serialize(file, wedstrijden);
|
||||
}
|
||||
}
|
||||
|
||||
public void PlaatsGok(int matchID, int persoonID, double inzet, string g)
|
||||
{
|
||||
try
|
||||
{
|
||||
Enum.TryParse(g, out Gokken gok);
|
||||
Keuze k = new Keuze(matchID, persoonID, inzet, gok);
|
||||
keuzes.Add(k);
|
||||
}catch(Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void GebruikerToevoegen(string voornaam, string naam, string adres, string gsm)
|
||||
{
|
||||
Persoon p = new Persoon(0, "Voornaam", "Naam", "Adres", "Gsm", 0.00);
|
||||
try
|
||||
{
|
||||
p = new Persoon(personen[personen.Count - 1].persoonID + 1, voornaam, naam, adres, gsm, 0);
|
||||
}
|
||||
catch
|
||||
{
|
||||
p = new Persoon(0, voornaam, naam, adres, gsm, 0);
|
||||
Debug.WriteLine("probleem met id settings");
|
||||
}
|
||||
personen.Add(p);
|
||||
FixDictonary();
|
||||
}
|
||||
|
||||
private void FixDictonary()
|
||||
{
|
||||
|
||||
personenMetId = new Dictionary<int, Persoon>();
|
||||
personenMetId.Clear();
|
||||
foreach (Persoon p in personen)
|
||||
{
|
||||
personenMetId.Add(p.persoonID, p);
|
||||
}
|
||||
}
|
||||
public void MaakVoorbeelden()
|
||||
{
|
||||
personen.Add(new Persoon(1, "john", "doe", "street", "048765656565", 0.15));
|
||||
wedstrijden.Add(new Wedstrijden(128, "belgie", "polen", 1, 0, 2.3, 3, 1.8));
|
||||
keuzes.Add(new Keuze(128, 1, 0.15, Gokken.Thuisploeg));
|
||||
FixDictonary();
|
||||
}
|
||||
|
||||
public List<string> GetGebruikers()
|
||||
{
|
||||
List<string> lijst = new List<string>();
|
||||
if (personen != null) {
|
||||
foreach(Persoon p in personen)
|
||||
{
|
||||
lijst.Add(p.persoonID+":"+p.naam + " " + p.voorNaam);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lijst.Add("None");
|
||||
}
|
||||
return lijst;
|
||||
}
|
||||
public List<string> GetWedstrijden()
|
||||
{
|
||||
List<string> temp = new List<string>();
|
||||
if (personen != null)
|
||||
{
|
||||
foreach (Wedstrijden w in wedstrijden)
|
||||
{
|
||||
temp.Add(w.thuisPloeg + " - " + w.uitPloeg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
temp.Add("None");
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
public List<string> GetGeldVerdubbeling(int ID)
|
||||
{
|
||||
List<string> lijst2 = new List<string>();
|
||||
if (personen != null)
|
||||
{
|
||||
foreach (Wedstrijden a in wedstrijden)
|
||||
{
|
||||
if(a.wedstrijdID == ID)
|
||||
{
|
||||
lijst2.Add(a.geldThuisPloeg + "");
|
||||
lijst2.Add(a.geldGelijk + "");
|
||||
lijst2.Add(a.geldUitPloeg + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lijst2.Add("None");
|
||||
lijst2.Add("None");
|
||||
lijst2.Add("None");
|
||||
}
|
||||
return lijst2;
|
||||
}
|
||||
public int[] GetPersoonID()
|
||||
{
|
||||
return personenMetId.Keys.ToArray();
|
||||
}
|
||||
public int[] GetWedstrijdID()
|
||||
{
|
||||
int[] wedstrijdID = new int[wedstrijden.Count];
|
||||
int teller = 0;
|
||||
foreach (Wedstrijden w in wedstrijden)
|
||||
{
|
||||
wedstrijdID[teller] = w.wedstrijdID;
|
||||
teller++;
|
||||
}
|
||||
return wedstrijdID;
|
||||
}
|
||||
private Wedstrijden GetWedstrijd(int ID)
|
||||
{
|
||||
foreach(Wedstrijden w in wedstrijden)
|
||||
{
|
||||
if(w.wedstrijdID == ID)
|
||||
{
|
||||
return w;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public double GetWinst(int ID)
|
||||
{
|
||||
double winst = 0;
|
||||
foreach (Keuze k in keuzes)
|
||||
{
|
||||
if(k.spelerID == ID)
|
||||
{
|
||||
Gokken g = k.gok;
|
||||
double temp = k.inzet;
|
||||
Wedstrijden w = GetWedstrijd(k.matchID);
|
||||
Gokken uitKomst = w.GetWinnaar();
|
||||
if(uitKomst == g)
|
||||
{
|
||||
switch (uitKomst)
|
||||
{
|
||||
case Gokken.Gelijk:
|
||||
winst += temp * w.geldGelijk;
|
||||
break;
|
||||
case Gokken.Thuisploeg:
|
||||
winst += temp * w.geldThuisPloeg;
|
||||
break;
|
||||
case Gokken.Uitploeg:
|
||||
winst += temp * w.geldUitPloeg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return winst;
|
||||
}
|
||||
|
||||
private Persoon GetPersoon(int id)
|
||||
{
|
||||
return personenMetId[id];
|
||||
}
|
||||
|
||||
public void ClonePersoon(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
Persoon clone = GetPersoon(id);
|
||||
|
||||
int [] lijst = GetPersoonID();
|
||||
int fixedID = lijst.Max()+1;
|
||||
//clone.persoonID = fixedID;
|
||||
Persoon test = new Persoon(clone);
|
||||
test.persoonID = fixedID;
|
||||
personen.Add(new Persoon(test));
|
||||
FixDictonary();
|
||||
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
//throw new Exception("Persoon kon niet gevonden worden met id, desync van de getId lijst op ui");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ClearList()
|
||||
{
|
||||
wedstrijden = new List<Wedstrijden>();
|
||||
personen = new List<Persoon>();
|
||||
keuzes = new List<Keuze>();
|
||||
}
|
||||
}
|
||||
}
|
81
Blok2 Online Gokkantoor/LogicLayer/Keuze.cs
Normal file
81
Blok2 Online Gokkantoor/LogicLayer/Keuze.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using DataLaag.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static DataLaag.Enums;
|
||||
|
||||
namespace LogicLayer
|
||||
{
|
||||
public class Keuze : IFKeuze
|
||||
{
|
||||
|
||||
public int matchID { get; set; }
|
||||
public int spelerID { get; set; }
|
||||
public double inzet { get; set; }
|
||||
public Gokken gok { get; set; } // thuis uit of gelijk
|
||||
|
||||
[JsonConstructor]
|
||||
public Keuze(int matchID, int spelerID, double inzet, Gokken gok)
|
||||
{
|
||||
string naam = "";
|
||||
string data = "";
|
||||
string varNaam = $"Probleem bij het ingeven van {naam} met waarde {data}";
|
||||
try
|
||||
{
|
||||
this.matchID = matchID;
|
||||
|
||||
} catch (Exception e)
|
||||
{
|
||||
naam = "matchID";
|
||||
data = matchID + "";
|
||||
throw new Exception(varNaam);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.spelerID = spelerID;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
naam = "spelerID";
|
||||
data = spelerID + "";
|
||||
throw new Exception(varNaam);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.inzet = inzet;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
naam = "inzet";
|
||||
data = inzet + "";
|
||||
throw new Exception(varNaam);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.gok = gok;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
naam = "gok";
|
||||
data = gok + "";
|
||||
throw new Exception(varNaam);
|
||||
}
|
||||
}
|
||||
public Keuze(Keuze keuze)
|
||||
{
|
||||
this.gok = keuze.gok;
|
||||
this.inzet = keuze.inzet;
|
||||
this.matchID = keuze.matchID;
|
||||
this.spelerID = keuze.spelerID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
63
Blok2 Online Gokkantoor/LogicLayer/LogicLayer.csproj
Normal file
63
Blok2 Online Gokkantoor/LogicLayer/LogicLayer.csproj
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{517C3448-BD87-4D62-9316-6BABBC9A9CFC}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>LogicLayer</RootNamespace>
|
||||
<AssemblyName>LogicLayer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="General.cs" />
|
||||
<Compile Include="Keuze.cs" />
|
||||
<Compile Include="Persoon.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Wedstrijden.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DataLaag\DataLaag.csproj">
|
||||
<Project>{ca62d8ea-2739-4c85-81b4-fba040592dae}</Project>
|
||||
<Name>DataLaag</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
99
Blok2 Online Gokkantoor/LogicLayer/Persoon.cs
Normal file
99
Blok2 Online Gokkantoor/LogicLayer/Persoon.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using DataLaag.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace LogicLayer
|
||||
{
|
||||
public class Persoon : IFPersoon
|
||||
{
|
||||
public int persoonID { get; set; }
|
||||
public string voorNaam { get; set; }
|
||||
public string naam { get; set; }
|
||||
public string adres { get; set; }
|
||||
public string gsm { get; set; }
|
||||
public double balans { get; set; }
|
||||
|
||||
[JsonConstructor]
|
||||
public Persoon(int persoonID, string voorNaam, string naam, string adres, string gsm, double balans)
|
||||
{
|
||||
string varNaam = "", data = "", er = $"Foutieve ingave: Probleem ingeven {varNaam} controleer syntax van {data}";
|
||||
|
||||
try
|
||||
{
|
||||
this.persoonID = persoonID;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
varNaam = "persoonID";
|
||||
data = persoonID + "";
|
||||
throw new Exception($"Foutieve ingave: Probleem aanmaken {varNaam} zie databank voor waarde {data}");
|
||||
}
|
||||
try
|
||||
{
|
||||
this.voorNaam = voorNaam;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
varNaam = "voorNaam";
|
||||
data = voorNaam + "";
|
||||
throw new Exception(er);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.naam = naam;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
varNaam = "naam";
|
||||
data = naam + "";
|
||||
throw new Exception(er);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.adres = adres;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
varNaam = "adres";
|
||||
data = adres + "";
|
||||
throw new Exception(er);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.gsm = gsm;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
varNaam = "gsm nummer";
|
||||
data = gsm + "";
|
||||
throw new Exception(er);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.balans = balans;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
varNaam = "balans";
|
||||
data = balans + "";
|
||||
throw new Exception($"Foutieve ingave: een probleem bij het setten van de {varNaam} : {data}");
|
||||
}
|
||||
}
|
||||
public Persoon(Persoon persoon)
|
||||
{
|
||||
persoonID = persoon.persoonID;
|
||||
voorNaam = persoon.voorNaam;
|
||||
naam = persoon.naam + " BACK UP";
|
||||
adres = persoon.adres;
|
||||
gsm = persoon.gsm;
|
||||
balans = persoon.balans;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("LogicLayer")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LogicLayer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("517c3448-bd87-4d62-9316-6babbc9a9cfc")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
124
Blok2 Online Gokkantoor/LogicLayer/Wedstrijden.cs
Normal file
124
Blok2 Online Gokkantoor/LogicLayer/Wedstrijden.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using DataLaag.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using static DataLaag.Enums;
|
||||
|
||||
namespace LogicLayer
|
||||
{
|
||||
public class Wedstrijden : IFWedstrijden
|
||||
{
|
||||
public int wedstrijdID { get; set; }
|
||||
public string thuisPloeg { get; set; }
|
||||
public string uitPloeg { get; set; }
|
||||
public int scoreThuisPloeg { get; set; }
|
||||
public int scoreUitPloeg { get; set; }
|
||||
public double geldThuisPloeg { get; set; }
|
||||
public double geldGelijk { get; set; }
|
||||
public double geldUitPloeg { get; set; }
|
||||
|
||||
|
||||
[JsonConstructor]
|
||||
public Wedstrijden(int wedstrijdID, string thuisPloeg, string uitPloeg, int scoreThuisPloeg, int scoreUitPloeg, double geldThuisPloeg, double geldGelijk, double geldUitPloeg)
|
||||
{
|
||||
string varNaam = "", data = "", error = $"Probleem bij het invoeren van {varNaam} met de waarde {data}";
|
||||
try
|
||||
{
|
||||
this.wedstrijdID = wedstrijdID;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
varNaam = "wedstrijdID";
|
||||
data = wedstrijdID + "";
|
||||
throw new Exception(error);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.thuisPloeg = thuisPloeg;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
varNaam = "thuisPloeg";
|
||||
data = thuisPloeg + "";
|
||||
throw new Exception(error);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.uitPloeg = uitPloeg;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
varNaam = "uitPloeg";
|
||||
data = uitPloeg + "";
|
||||
throw new Exception(error);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.scoreThuisPloeg = scoreThuisPloeg;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
varNaam = "scoreThuisPloeg";
|
||||
data = scoreThuisPloeg + "";
|
||||
throw new Exception(error);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.scoreUitPloeg = scoreUitPloeg;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
varNaam = "scoreUitPloeg";
|
||||
data = scoreUitPloeg + "";
|
||||
throw new Exception(error);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.geldThuisPloeg = geldThuisPloeg;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
varNaam = "geldThuisPloeg";
|
||||
data = geldThuisPloeg + "";
|
||||
throw new Exception(error);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.geldGelijk = geldGelijk;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
varNaam = "geldGelijk";
|
||||
data = geldGelijk + "";
|
||||
throw new Exception(error);
|
||||
}
|
||||
try
|
||||
{
|
||||
this.geldUitPloeg = geldUitPloeg;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
varNaam = "geldUitPloeg";
|
||||
data = geldUitPloeg + "";
|
||||
throw new Exception(error);
|
||||
}
|
||||
}
|
||||
|
||||
public Gokken GetWinnaar()
|
||||
{
|
||||
if(scoreThuisPloeg > scoreUitPloeg)
|
||||
{
|
||||
return Gokken.Thuisploeg;
|
||||
}else if(scoreUitPloeg > scoreThuisPloeg)
|
||||
{
|
||||
return Gokken.Uitploeg;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Gokken.Gelijk;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
4
Blok2 Online Gokkantoor/LogicLayer/packages.config
Normal file
4
Blok2 Online Gokkantoor/LogicLayer/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
|
||||
</packages>
|
Reference in New Issue
Block a user