first commit because I dont want to lose this project

This commit is contained in:
2023-01-02 11:27:38 +01:00
commit 99aca49290
18 changed files with 1740 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
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;
namespace Caisses
{
public partial class Form1 : Form
{
GraphicalStore store;
public Form1()
{
InitializeComponent();
DoubleBuffered = true;
store = new GraphicalStore(10,12,pbxRayons.Size,pbxCaisses.Size);
}
private void btnStartStop_Click(object sender, EventArgs e)
{
if (tmrRefresh.Enabled)
{
tmrRefresh.Stop();
tmrDraw.Stop();
btnStartStop.Text = "Start";
}
else
{
tmrRefresh.Start();
tmrDraw.Start();
btnStartStop.Text = "Stop";
}
}
private void tmrRefresh_Tick(object sender, EventArgs e)
{
store.Tick();
}
private void tmrDraw_Tick(object sender, EventArgs e)
{
List<Bitmap> result = store.Draw();
if (pbxRayons.Image != null)
{
pbxRayons.Image.Dispose();
}
if (pbxCaisses.Image != null)
{
pbxCaisses.Image.Dispose();
}
pbxRayons.Image = result[0];
pbxCaisses.Image = result[1];
lblClients.Text = "Clients : " + store.Clients.Count();
lblClientsWithoutCheckout.Text = "Clients without checkout : "+ store.GetClientsWithoutCheckout().Count();
lblAvaiblePlaces.Text = "Avaible places = " + store.GetAmountOfPlacesLeft();
lblAvgWaitingTime.Text = "AverageWaitingTime = " + store.GetAverageWaitingTime();
lblTime.Text = "Time of the day : "+store.TimeOfTheDayInHours + ":"+store.TimeOfTheDayInMinuts % 60;
}
}
}