mirror of
https://github.com/bvanroll/cs-oo-project.git
synced 2025-08-29 20:12:40 +00:00
euh
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
[]
|
||||
[{"date":"2015-01-01T00:00:00","Id":0
|
@@ -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}]
|
@@ -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");
|
||||
|
||||
}
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user