Skip to content

Commit

Permalink
Merged waiter and admin to master finally
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Langlais authored and Evan Langlais committed Apr 6, 2017
2 parents 3fd3a4f + 41e4ab7 commit ed719e3
Show file tree
Hide file tree
Showing 23 changed files with 1,068 additions and 106 deletions.
21 changes: 21 additions & 0 deletions Enigma/Enigma.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@
<Compile Include="Popups\AddPopup.Designer.cs">
<DependentUpon>AddPopup.cs</DependentUpon>
</Compile>
<Compile Include="Popups\checkoutTablePopup.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Popups\checkoutTablePopup.Designer.cs">
<DependentUpon>checkoutTablePopup.cs</DependentUpon>
</Compile>
<Compile Include="Popups\chequePrintPopup.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Popups\chequePrintPopup.Designer.cs">
<DependentUpon>chequePrintPopup.cs</DependentUpon>
</Compile>
<Compile Include="Popups\resAdd.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -128,6 +140,12 @@
<Compile Include="Stations\DebugStation.cs" />
<Compile Include="Stations\WaiterStation.cs" />
<Compile Include="Stations\HostStation.cs" />
<EmbeddedResource Include="Popups\checkoutTablePopup.resx">
<DependentUpon>checkoutTablePopup.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Popups\chequePrintPopup.resx">
<DependentUpon>chequePrintPopup.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Popups\AddPopup.resx">
<DependentUpon>AddPopup.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -191,6 +209,9 @@
<ItemGroup>
<None Include="Resources\lonely_sun_by_butterflypics-d8orr9a.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\gradient-background-26046-26731-hd-wallpapers.jpg.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ring-alt.gif" />
</ItemGroup>
Expand Down
37 changes: 23 additions & 14 deletions Enigma/EnigmaMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Enigma/EnigmaMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private void hostButton_Click(object sender, EventArgs e)
station.showView();
}


private void debugButton_Click(object sender, EventArgs e)
{
DebugStation station = new DebugStation(EnigmaX.Classes.StationTypeDef.host, "debug");
Expand All @@ -73,5 +74,12 @@ private void adminButton_Click(object sender, EventArgs e)
loadedStations.Add(station);
station.showView();
}

private void waiterbutton_Click(object sender, EventArgs e)
{
WaiterStation station = new WaiterStation("debugwaiter");
loadedStations.Add(station);
station.showView();
}
}
}
1 change: 1 addition & 0 deletions Enigma/Popups/TableAssign.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions Enigma/Popups/checkoutTablePopup.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions Enigma/Popups/checkoutTablePopup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MetroFramework.Forms;
using EnigmaX;
using EnigmaX.Classes;
using Enigma.StationsGUI;
using MySql.Data.MySqlClient;

namespace Enigma.Popups
{
public partial class checkoutTablePopup : MetroForm
{
WaiterStationView wsv = new WaiterStationView();
public checkoutTablePopup(WaiterStationView waiterStation)
{
InitializeComponent();
wsv = waiterStation;
}

private void checkoutTablePopup_Load(object sender, EventArgs e)
{

}

private void confirm_Click(object sender, EventArgs e)
{
DBConnect db = new DBConnect();
db.getConnection().Open();
MySqlCommand cmd = new MySqlCommand("UPDATE Seating SET status = @status WHERE tableNumber = @tableNumber", db.getConnection());
//parametrize the variables
cmd.Parameters.AddWithValue("@status", 1);
cmd.Parameters.AddWithValue("@tableNumber", wsv._tableNumber);
cmd.ExecuteNonQuery();

cmd = new MySqlCommand("UPDATE Seating SET tableOrder = @tableOrder WHERE tableNumber = @tableNumber", db.getConnection());
cmd.Parameters.AddWithValue("@tableOrder", null);
cmd.Parameters.AddWithValue("@tableNumber", wsv._tableNumber);
cmd.ExecuteNonQuery();

db.getConnection().Close();
}
}
}
Loading

0 comments on commit ed719e3

Please sign in to comment.