public frmAddToOrder(ref TillEngine.TillEngine te) { tEngine = te; this.BackColor = GTill.Properties.Settings.Default.cFrmBackColour; this.ForeColor = GTill.Properties.Settings.Default.cFrmForeColour; this.FormBorderStyle = FormBorderStyle.None; this.StartPosition = FormStartPosition.CenterParent; this.Width = 500; this.Height = 100; lblInst = new Label(); lblInst.Location = new Point(10, 10); lblInst.AutoSize = true; lblInst.BackColor = this.BackColor; lblInst.ForeColor = this.ForeColor; lblInst.Font = new Font(GTill.Properties.Settings.Default.sFontName, 12.0f); lblInst.Text = "Enter the barcode of the item to order (press look up to search) :"; this.Controls.Add(lblInst); tbBarcode = new TextBox(); tbBarcode.Location = new Point(10, 40); tbBarcode.Width = 200; tbBarcode.BorderStyle = BorderStyle.None; tbBarcode.BackColor = this.ForeColor; tbBarcode.ForeColor = this.BackColor; tbBarcode.Font = new Font(GTill.Properties.Settings.Default.sFontName, 12.0f); this.Controls.Add(tbBarcode); tbBarcode.KeyDown += new KeyEventHandler(tbBarcode_KeyDown); }
public frmStats(ref TillEngine.TillEngine tE, Size s, Point p, ChartType cTypes) { this.Size = s; this.FormBorderStyle = FormBorderStyle.None; this.Location = p; this.BackColor = GTill.Properties.Settings.Default.cFrmBackColour; this.ForeColor = GTill.Properties.Settings.Default.cFrmForeColour; tEngine = tE; lblTitle = new Label(); lblTitle.Text = "Sales Analysis - Amount Taken"; lblTitle.AutoSize = false; lblTitle.Top = 0; lblTitle.Left = 0; lblTitle.Width = this.Width; lblTitle.Height = 40; lblTitle.Font = new Font(GTill.Properties.Settings.Default.sFontName, 20.0f); lblTitle.TextAlign = ContentAlignment.TopCenter; lblExit = new Label(); lblExit.Text = "Press any key to close."; lblExit.Location = new Point(0, this.Height - 50); lblExit.Size = new Size(this.Width, 30); cChartType = cTypes; lblExit.Font = new Font(GTill.Properties.Settings.Default.sFontName, 20.0f); lblExit.TextAlign = ContentAlignment.TopCenter; WorkOutAngles(); //this.Controls.Add(lblExit); //this.Controls.Add(lblTitle); this.KeyDown += new KeyEventHandler(frmStats_KeyDown); this.Paint += new PaintEventHandler(frmStats_Paint); }
public frmReceiveOnAccount(Point p, Size s, ref TillEngine.TillEngine te) { cFrmBackColour = Properties.Settings.Default.cFrmBackColour; cFrmForeColour = Properties.Settings.Default.cFrmForeColour; sSize = s; pLocation = p; tEngine = te; sFontName = Properties.Settings.Default.sFontName; ShowAccountDialog(); }
public frmShutDownWait(ref TillEngine.TillEngine te) { tEngine = te; this.Paint += new PaintEventHandler(frmShutDownWait_Paint); this.BackColor = GTill.Properties.Settings.Default.cFrmBackColour; this.Font = new Font(GTill.Properties.Settings.Default.sFontName, 20.0f, FontStyle.Bold); this.WindowState = FormWindowState.Maximized; this.FormBorderStyle = FormBorderStyle.None; tmr.Interval = 1000; tmr.Tick += new EventHandler(tmr_Tick); tmr.Enabled = true; this.KeyDown += new KeyEventHandler(frmShutDownWait_KeyDown); }
public frmRefund(Size s, Point pFrmStartLoc, ref TillEngine.TillEngine t) { this.FormBorderStyle = FormBorderStyle.None; this.BackColor = Properties.Settings.Default.cFrmBackColour; this.ForeColor = Properties.Settings.Default.cFrmForeColour; this.StartPosition = FormStartPosition.Manual; this.Size = s; cFrmBackColour = Properties.Settings.Default.cFrmBackColour; cFrmForeColour = Properties.Settings.Default.cFrmForeColour; sFontName = Properties.Settings.Default.sFontName; tEngine = t; this.Location = pFrmStartLoc; SetupForm(FormState.RefundTypeSelection); this.Paint += new PaintEventHandler(frmRefund_Paint); }
/// <summary> /// Initialises the form /// </summary> /// <param name="p">The location of the form</param> /// <param name="s">The size of the form</param> /// <param name="te">A reference to the TillEngine</param> public frmPresetKeys(Point p, Size s, ref TillEngine.TillEngine te) { this.FormBorderStyle = FormBorderStyle.None; this.StartPosition = FormStartPosition.Manual; this.Size = s; this.Location = p; this.BackColor = Properties.Settings.Default.cFrmBackColour; this.ForeColor = Properties.Settings.Default.cFrmForeColour; cFrmBackColour = Properties.Settings.Default.cFrmBackColour; cFrmForeColour = Properties.Settings.Default.cFrmForeColour; sFontName = Properties.Settings.Default.sFontName; tEngine = te; SetupForm(); this.Paint += new PaintEventHandler(frmPresetKeys_Paint); }
/// <summary> /// Initialises the menu /// </summary> /// <param name="mtMenuType">The type of menu to show</param> /// <param name="s">The size of the menu</param> /// <param name="t">A reference to the TillEngine</param> public frmMenu(MenuType mtMenuType, Size s, ref TillEngine.TillEngine t) { rAroundListboxes = new Rectangle(0, 0, 0, 0); this.Size = s; this.StartPosition = FormStartPosition.CenterScreen; currentMenuType = mtMenuType; sFontName = Properties.Settings.Default.sFontName; sShopName = t.ShopName; cFrmBackColour = Properties.Settings.Default.cFrmBackColour; cFrmForeColour = Properties.Settings.Default.cFrmForeColour; this.BackColor = cFrmBackColour; this.ForeColor = cFrmForeColour; this.FormBorderStyle = FormBorderStyle.None; this.ForeColor = cFrmForeColour; tEngine = t; CreateMenu(mtMenuType); this.Paint += new PaintEventHandler(frmMenu_Paint); }
public frmOfferSelect(ref TillEngine.TillEngine te) { tEngine = te; this.FormBorderStyle = FormBorderStyle.None; this.StartPosition = FormStartPosition.CenterScreen; this.BackColor = GTill.Properties.Settings.Default.cFrmBackColour; this.ForeColor = GTill.Properties.Settings.Default.cFrmForeColour; this.Size = new Size(640, 480); lbOffers = new ListBox(); lbOffers.Location = new Point(15, 15); lbOffers.Size = new Size(this.Width - 30, this.Height - 30); lbOffers.Font = new Font(GTill.Properties.Settings.Default.sFontName, 16.0f); lbOffers.BorderStyle = BorderStyle.None; lbOffers.KeyDown += new KeyEventHandler(lbOffers_KeyDown); this.Controls.Add(lbOffers); AddOffers(); }
void DrawWeekGraph(Graphics g) { string[] sNoStats = GTill.Properties.Settings.Default.sNoStatsAbout.Split(','); int[] nNoStats = new int[sNoStats.Length]; int nOfHoursToShow = 63; for (int i = 0; i < sNoStats.Length; i++) { try { nNoStats[i] = Convert.ToInt32(sNoStats[i]); } catch { nNoStats[i] = 0; } } int nNameLeft = 0; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; int nCurrentPieColour = 0; Point pBottomLeft = new Point((this.Width / 8), this.Height - (this.Height / 8)); float fTotalAmount = 0.0f; for (int i = 0; i < fStaffSales.Length; i++) { bool bStaffOptedOut = false; for (int x = 0; x < nNoStats.Length; x++) { if (i == nNoStats[x]) { bStaffOptedOut = true; } } if (fTotalAmount < fStaffSales[i] && !bStaffOptedOut) { fTotalAmount = fStaffSales[i]; } } float fAmountEachYPixel = (float)fTotalAmount / (float)((this.Height / 4) * 3); float fAmountEachXPixel = (float)(nOfHoursToShow * 60) / (float)((this.Width / 4) * 3) / 7; // 9 hours @ 60 mins each // Go through each sale //Set up array of tillEngines TillEngine.TillEngine[] tEngines = new TillEngine.TillEngine[7]; for (int i = 0; i < 7; i++) { tEngines[i] = new TillEngine.TillEngine(); tEngines[i].LoadTable(GTill.Properties.Settings.Default.sOUTGNGDir + "\\REPDATA" + (i + 1).ToString() + ".DBF"); tEngines[i].LoadTable(GTill.Properties.Settings.Default.sOUTGNGDir + "\\TDATA" + (i + 1).ToString() + ".DBF"); tEngines[i].LoadTable(GTill.Properties.Settings.Default.sOUTGNGDir + "\\THDR" + (i + 1).ToString() + ".DBF"); } int nToday = tEngine.GetDayNumberFromRepData(); for (int nDayNum = (nToday + 1) % 7; nDayNum < 7 + ((nToday + 1) % 7); nDayNum++) { string[] sSales = tEngines[nDayNum].GetListOfTransactionNumbers(); for (int x = 0; x < 10; x++) { float fCumulativeTotal = 0.0f; Point pLastPoint = pBottomLeft; string sStaffName = ""; sStaffName = tEngine.GetStaffName(x); bool bStaffOptedOut = false; for (int i = 0; i < nNoStats.Length; i++) { if (x == nNoStats[i]) { bStaffOptedOut = true; } } if (sStaffName != "" && !bStaffOptedOut) { for (int i = 0; i < sSales.Length; i++) { string[,] sTransactionInfo = tEngines[nDayNum].GetTransactionInfo(sSales[i]); if (sStaffName == tEngine.ReturnSensibleDateTimeString(sTransactionInfo[0, 2])[1]) { // This is one of the staff member's transactions, so plot a point // Work out the value of the transaction float fTransactionValue = 0.0f; int nOfItemsInTransaction = Convert.ToInt32(sTransactionInfo[0, 0]); for (int z = 1; z <= nOfItemsInTransaction; z++) { fTransactionValue += (float)Convert.ToDecimal(sTransactionInfo[z, 2]); } fTransactionValue = TillEngine.TillEngine.FixFloatError(fTransactionValue); fCumulativeTotal += fTransactionValue; fCumulativeTotal = TillEngine.TillEngine.FixFloatError(fCumulativeTotal); int yPos = this.Height - (this.Height / 8) - (int)Math.Round(fCumulativeTotal / fAmountEachYPixel, 0); string stime = tEngine.ReturnSensibleDateTimeString(sTransactionInfo[0, 2])[0].Split(' ')[1].Replace(':', '.'); int nMinutesTotal = 0; nMinutesTotal += (Convert.ToInt32(stime.Split('.')[0]) * 60) - (9 * 60); nMinutesTotal += Convert.ToInt32(stime.Split('.')[1]); int xPos = (int)Math.Round(nMinutesTotal / fAmountEachXPixel) + (this.Width / 8); g.DrawLine(new Pen(cPieColours[nCurrentPieColour], 3.0f), pLastPoint, new Point(xPos, yPos)); pLastPoint = new Point(xPos, yPos); } } if (fStaffSales[x] > 0.0f) { g.DrawString(tEngine.GetStaffName(x), new Font(GTill.Properties.Settings.Default.sFontName, 20.0f), new SolidBrush(cPieColours[nCurrentPieColour]), new PointF((float)nNameLeft, 0.0f)); nNameLeft += (int)g.MeasureString(tEngine.GetStaffName(x), new Font(GTill.Properties.Settings.Default.sFontName, 20.0f)).Width; nCurrentPieColour++; if (nCurrentPieColour >= cPieColours.Length) { nCurrentPieColour = 0; } } } } } g.DrawLine(new Pen(GTill.Properties.Settings.Default.cFrmForeColour, 2.0f), pBottomLeft, new Point(this.Width / 8, this.Height / 8)); g.DrawLine(new Pen(GTill.Properties.Settings.Default.cFrmForeColour, 2.0f), pBottomLeft, new Point(this.Width - (this.Width / 8), this.Height - (this.Height / 8))); g.DrawLine(new Pen(GTill.Properties.Settings.Default.cFrmForeColour, 2.0f), pBottomLeft, new Point((this.Width / 8) - 15, this.Height - (this.Height / 8))); g.DrawLine(new Pen(GTill.Properties.Settings.Default.cFrmForeColour, 2.0f), new Point(this.Width / 8, this.Height / 8), new Point((this.Width / 8) - 15, this.Height / 8)); g.DrawString(tEngine.CurrencySymbol.ToString() + "0.00", new Font(GTill.Properties.Settings.Default.sFontName, 16.0f), new SolidBrush(GTill.Properties.Settings.Default.cFrmForeColour), new PointF(pBottomLeft.X - 15 - g.MeasureString(tEngine.CurrencySymbol.ToString() + "0.00", new Font(GTill.Properties.Settings.Default.sFontName, 16.0f)).Width, pBottomLeft.Y - g.MeasureString(tEngine.CurrencySymbol.ToString() + "0.00", new Font(GTill.Properties.Settings.Default.sFontName, 16.0f)).Height / 2)); g.DrawString(tEngine.CurrencySymbol.ToString() + TillEngine.TillEngine.FormatMoneyForDisplay(fTotalAmount), new Font(GTill.Properties.Settings.Default.sFontName, 16.0f), new SolidBrush(GTill.Properties.Settings.Default.cFrmForeColour), new PointF(pBottomLeft.X - 15 - g.MeasureString(tEngine.CurrencySymbol.ToString() + TillEngine.TillEngine.FormatMoneyForDisplay(fTotalAmount), new Font(GTill.Properties.Settings.Default.sFontName, 16.0f)).Width, (this.Height / 8) - g.MeasureString(tEngine.CurrencySymbol.ToString() + TillEngine.TillEngine.FormatMoneyForDisplay(fTotalAmount), new Font(GTill.Properties.Settings.Default.sFontName, 16.0f)).Height / 2)); int nDiff = ((this.Width / 4) * 3) / nOfHoursToShow; for (int t = 0; t <= 9; t++) { g.DrawLine(new Pen(GTill.Properties.Settings.Default.cFrmForeColour, 2.0f), new Point((this.Width / 8) + (nDiff * t), pBottomLeft.Y), new Point((this.Width / 8) + (nDiff * t), pBottomLeft.Y + 15)); g.DrawString((t + 9).ToString(), new Font(GTill.Properties.Settings.Default.sFontName, 16.0f), new SolidBrush(GTill.Properties.Settings.Default.cFrmForeColour), new PointF((this.Width / 8) + (nDiff * t) - (g.MeasureString((9 + t).ToString(), new Font(GTill.Properties.Settings.Default.sFontName, 16.0f)).Height / 2), this.Height - (this.Height / 8) + 20)); } g.DrawString("Hour", new Font(GTill.Properties.Settings.Default.sFontName, 20.0f), new SolidBrush(GTill.Properties.Settings.Default.cFrmForeColour), new PointF((this.Width / 2) - 15, this.Height - 50)); g.DrawString("Amount", new Font(GTill.Properties.Settings.Default.sFontName, 20.0f), new SolidBrush(GTill.Properties.Settings.Default.cFrmForeColour), new PointF(this.Width / 8 - g.MeasureString("Amount", new Font(GTill.Properties.Settings.Default.sFontName, 20.0f)).Width - 15, (this.Height / 8) - 50)); g.DrawString("Cumulative Sales", new Font(GTill.Properties.Settings.Default.sFontName, 20.0f), new SolidBrush(GTill.Properties.Settings.Default.cFrmForeColour), new PointF((this.Width / 2) - (g.MeasureString("Hourly Sales", new Font(GTill.Properties.Settings.Default.sFontName, 20.0f)).Width / 2), g.MeasureString("ThomasIsMyName", new Font(GTill.Properties.Settings.Default.sFontName, 20.0f)).Height)); for (int t = 0; t <= 9; t++) { g.DrawLine(new Pen(GTill.Properties.Settings.Default.cFrmForeColour, 2.0f), new Point(pBottomLeft.X - 15, pBottomLeft.Y - (t * (((this.Height / 4) * 3) / 10))), new Point(pBottomLeft.X, pBottomLeft.Y - (t * (((this.Height / 4) * 3) / 10)))); g.DrawString(tEngine.CurrencySymbol.ToString() + TillEngine.TillEngine.FormatMoneyForDisplay((fTotalAmount / 10) * t), new Font(GTill.Properties.Settings.Default.sFontName, 16.0f), new SolidBrush(GTill.Properties.Settings.Default.cFrmForeColour), new PointF(pBottomLeft.X - 15 - (int)g.MeasureString(tEngine.CurrencySymbol + TillEngine.TillEngine.FormatMoneyForDisplay((fTotalAmount / 10) * t), new Font(GTill.Properties.Settings.Default.sFontName, 16.0f)).Width, pBottomLeft.Y - (t * (((this.Height / 4) * 3) / 10)) - (g.MeasureString(tEngine.CurrencySymbol.ToString(), new Font(GTill.Properties.Settings.Default.sFontName, 16.0f)).Height / 2))); } }