This commit is contained in:
Beppe
2019-07-06 01:41:20 +02:00
parent df39b0392c
commit d883bce694
16 changed files with 110 additions and 33 deletions

View File

@@ -46,9 +46,9 @@ namespace Gui
public void updateGame_Click(object sender, EventArgs args)
{
logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
IList<Game> boundList2 = (IList<Game>)listGames.DataSource;
HttpContext.Current.Application["currGame"] = boundList2[listGames.SelectedIndex];
HttpContext.Current.Application["currGame"] = logic.getGameByString(listGames.SelectedValue);
Server.Transfer("updateGame.aspx");
}

View File

@@ -1 +1 @@
[]
[{"date":"2015-01-01T00:00:00","Id":0

View File

@@ -1 +1 @@
[{"Id":0,"naam":"bepkes","score":-2147483648,"scoreSet":false},{"Id":1,"naam":"selmakes","score":-2147483648,"scoreSet":false}]
[{"Id":0,"naam":"jfkldjslkfj","score":-2147483648,"scoreSet":false},{"Id":1,"naam":"vdvdvd","score":-2147483648,"scoreSet":false}]

View File

@@ -14,22 +14,35 @@ namespace Gui
if (!Page.IsPostBack)
{
LogicLayer logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
lstUsers.DataSource = logic.persons;
lstUsers.DataBind();
}
}
protected override void OnInitComplete(EventArgs e)
{
base.OnInitComplete(e);
LogicLayer logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
lstUsers.DataSource = logic.persons;
lstUsers.DataBind();
}
protected override void OnPreLoad(EventArgs e)
{
base.OnPreLoad(e);
LogicLayer logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
lstUsers.DataSource = logic.persons;
lstUsers.DataBind();
}
protected override void OnLoadComplete(EventArgs e)
{
base.OnLoadComplete(e);
LogicLayer logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
lstUsers.DataSource = logic.persons;
lstUsers.DataBind();
}
public void Login_Click(object o, EventArgs e)
{
HttpContext.Current.Application["user"] = lstUsers.SelectedItem;
LogicLayer logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
HttpContext.Current.Application["user"] = logic.getPersonByString(lstUsers.SelectedValue);
Server.Transfer("mainForm.aspx");
}

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using Globals;
using Globals.classes;
using Logic;
using static Globals.main;
@@ -29,12 +30,8 @@ namespace Gui
logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
try
{
Game currGame = (Game)HttpContext.Current.Application["currGame"];
IList<state> boundList2 = (IList<state>)teams.DataSource;
state currPloeg = boundList2[teams.SelectedIndex];
state currPloeg = (state)Enum.Parse(typeof(state), teams.SelectedValue);
double cash = double.Parse(amount.Text);
Person currPers = (Person)HttpContext.Current.Application["user"];
if (cash > currPers.balance)

View File

@@ -12,6 +12,8 @@ namespace Gui
public partial class addMatch : System.Web.UI.Page
{
LogicLayer logic;
static List<Ploeg> p;
protected void Page_Load(object sender, EventArgs e)
{
@@ -19,24 +21,25 @@ namespace Gui
{
logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
dag.DataSource = Enumerable.Range(1, 31).ToArray<int>();
dag.DataBind();
maand.DataSource= Enumerable.Range(1, 12).ToArray<int>();
maand.DataBind();
jaar.DataSource = Enumerable.Range(2015, 10).ToArray<int>();
jaar.DataBind();
ploeg1.DataSource = logic.ploegen;
p = logic.ploegen;
ploeg1.DataSource = p;
ploeg2.DataSource = p;
ploeg1.DataBind();
ploeg2.DataSource = logic.ploegen;
ploeg2.DataBind();
jaar.DataBind();
maand.DataBind();
dag.DataBind();
}
}
public void matchadd_Click(object sender, EventArgs e)
{
IList<Ploeg> p1l = (IList<Ploeg>)ploeg1.DataSource;
IList<Ploeg> p2l = (IList<Ploeg>)ploeg2.DataSource;
Ploeg home = p1l[ploeg1.SelectedIndex];
Ploeg away = p2l[ploeg2.SelectedIndex];
logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
Ploeg home = logic.getPloegByString(ploeg1.SelectedValue);
Ploeg away = logic.getPloegByString(ploeg2.SelectedValue);
int d, m, y = 0;
if (home == away)
{
@@ -62,9 +65,6 @@ namespace Gui
statusLabel.Text = "There was a problem parsing the data try again";
return;
}
Game g = new Game(home, away, new DateTime(y, m, d));
logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
logic.addGame(g);

View File

@@ -26,6 +26,7 @@ namespace Gui
logic.addPloeg(p);
logic.save();
HttpContext.Current.Application["logic"] = logic;
Response.Redirect("Admin.aspx");
}
public void ret_Click(object sender, EventArgs e)
{

View File

@@ -1,6 +1,8 @@
using System;
using System.Diagnostics;
using System.Web;
using System.Web.UI;
using Globals.classes;
using Logic;
namespace Gui
@@ -17,6 +19,8 @@ namespace Gui
logic = (LogicLayer)System.Web.HttpContext.Current.Application["logic"];
listGames.DataSource = logic.games;
listGames.DataBind();
Person test = (Globals.classes.Person)HttpContext.Current.Application["user"];
Debug.Print(test.ToString());
}
}