diff --git a/Enigma/StationsGUI/AdminStationView.Designer.cs b/Enigma/StationsGUI/AdminStationView.Designer.cs index 42bb4e1..67f8af9 100644 --- a/Enigma/StationsGUI/AdminStationView.Designer.cs +++ b/Enigma/StationsGUI/AdminStationView.Designer.cs @@ -34,7 +34,7 @@ private void InitializeComponent() this.menuListBox = new System.Windows.Forms.ListBox(); this.menuSaveButton = new MetroFramework.Controls.MetroButton(); this.menuRevertButton = new MetroFramework.Controls.MetroButton(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.menuOptions = new System.Windows.Forms.GroupBox(); this.label1 = new System.Windows.Forms.Label(); this.displayedOnDevices = new System.Windows.Forms.ListBox(); this.menuGroup1 = new System.Windows.Forms.GroupBox(); @@ -51,10 +51,10 @@ private void InitializeComponent() this.itemDescriptionTextbox = new MetroFramework.Controls.MetroTextBox(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); - this.printingListBox = new System.Windows.Forms.ListBox(); + this.itemPrintingListBox = new System.Windows.Forms.ListBox(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); - this.categoryListBox = new System.Windows.Forms.ListBox(); + this.itemCategoryListBox = new System.Windows.Forms.ListBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.removeItemButton = new MetroFramework.Controls.MetroButton(); this.renameItemButton = new MetroFramework.Controls.MetroButton(); @@ -65,16 +65,14 @@ private void InitializeComponent() this.metroButton5 = new MetroFramework.Controls.MetroButton(); this.employeeListBox = new System.Windows.Forms.ListBox(); this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.lastNameTextBox = new MetroFramework.Controls.MetroTextBox(); + this.employeeLastNameTextBox = new MetroFramework.Controls.MetroTextBox(); this.label11 = new System.Windows.Forms.Label(); - this.firstNameTextBox = new MetroFramework.Controls.MetroTextBox(); + this.employeeFirstNameTextBox = new MetroFramework.Controls.MetroTextBox(); this.label10 = new System.Windows.Forms.Label(); - this.pinNumber = new System.Windows.Forms.NumericUpDown(); - this.usernameTextBox = new MetroFramework.Controls.MetroTextBox(); + this.employeePinNumber = new System.Windows.Forms.NumericUpDown(); this.pin = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); - this.listBox2 = new System.Windows.Forms.ListBox(); + this.employeeRoleListBox = new System.Windows.Forms.ListBox(); this.groupBox7 = new System.Windows.Forms.GroupBox(); this.employeeRemoveButton = new MetroFramework.Controls.MetroButton(); this.employeeAddButton = new MetroFramework.Controls.MetroButton(); @@ -93,7 +91,7 @@ private void InitializeComponent() this.metroLabel3 = new MetroFramework.Controls.MetroLabel(); this.adminTabControl.SuspendLayout(); this.menuTab.SuspendLayout(); - this.groupBox1.SuspendLayout(); + this.menuOptions.SuspendLayout(); this.menuGroup1.SuspendLayout(); this.itemsTab.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -101,7 +99,7 @@ private void InitializeComponent() this.groupBox3.SuspendLayout(); this.employeeTab.SuspendLayout(); this.groupBox6.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pinNumber)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.employeePinNumber)).BeginInit(); this.groupBox7.SuspendLayout(); this.stationTab.SuspendLayout(); this.groupBox4.SuspendLayout(); @@ -119,7 +117,7 @@ private void InitializeComponent() this.adminTabControl.Controls.Add(this.stationTab); this.adminTabControl.Location = new System.Drawing.Point(23, 63); this.adminTabControl.Name = "adminTabControl"; - this.adminTabControl.SelectedIndex = 0; + this.adminTabControl.SelectedIndex = 2; this.adminTabControl.Size = new System.Drawing.Size(1368, 832); this.adminTabControl.TabIndex = 0; this.adminTabControl.UseSelectable = true; @@ -131,7 +129,7 @@ private void InitializeComponent() this.menuTab.Controls.Add(this.menuListBox); this.menuTab.Controls.Add(this.menuSaveButton); this.menuTab.Controls.Add(this.menuRevertButton); - this.menuTab.Controls.Add(this.groupBox1); + this.menuTab.Controls.Add(this.menuOptions); this.menuTab.Controls.Add(this.menuGroup1); this.menuTab.Controls.Add(this.metroLabel1); this.menuTab.HorizontalScrollbarBarColor = true; @@ -145,6 +143,7 @@ private void InitializeComponent() this.menuTab.VerticalScrollbarBarColor = true; this.menuTab.VerticalScrollbarHighlightOnWheel = false; this.menuTab.VerticalScrollbarSize = 10; + this.menuTab.Click += new System.EventHandler(this.menuTab_Click); // // menuSelectionBox // @@ -207,21 +206,21 @@ private void InitializeComponent() this.menuRevertButton.Text = "Revert"; this.menuRevertButton.UseSelectable = true; // - // groupBox1 + // menuOptions // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.menuOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.BackColor = System.Drawing.Color.Transparent; - this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Controls.Add(this.displayedOnDevices); - this.groupBox1.Font = new System.Drawing.Font("Segoe UI Light", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox1.Location = new System.Drawing.Point(741, 287); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(8); - this.groupBox1.Size = new System.Drawing.Size(595, 418); - this.groupBox1.TabIndex = 7; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Options"; + this.menuOptions.BackColor = System.Drawing.Color.Transparent; + this.menuOptions.Controls.Add(this.label1); + this.menuOptions.Controls.Add(this.displayedOnDevices); + this.menuOptions.Font = new System.Drawing.Font("Segoe UI Light", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.menuOptions.Location = new System.Drawing.Point(741, 287); + this.menuOptions.Name = "menuOptions"; + this.menuOptions.Padding = new System.Windows.Forms.Padding(8); + this.menuOptions.Size = new System.Drawing.Size(595, 418); + this.menuOptions.TabIndex = 7; + this.menuOptions.TabStop = false; + this.menuOptions.Text = "Options"; // // label1 // @@ -378,9 +377,9 @@ private void InitializeComponent() "Item3"}); this.menuItemListBox.Location = new System.Drawing.Point(7, 69); this.menuItemListBox.Name = "menuItemListBox"; - this.menuItemListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; this.menuItemListBox.Size = new System.Drawing.Size(696, 650); this.menuItemListBox.TabIndex = 8; + this.menuItemListBox.SelectedIndexChanged += new System.EventHandler(this.menuItemListBox_SelectedIndexChanged); // // itemsRevertButton // @@ -403,10 +402,10 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.itemDescriptionTextbox); this.groupBox2.Controls.Add(this.label5); this.groupBox2.Controls.Add(this.label4); - this.groupBox2.Controls.Add(this.printingListBox); + this.groupBox2.Controls.Add(this.itemPrintingListBox); this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.label2); - this.groupBox2.Controls.Add(this.categoryListBox); + this.groupBox2.Controls.Add(this.itemCategoryListBox); this.groupBox2.Font = new System.Drawing.Font("Segoe UI Light", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.groupBox2.Location = new System.Drawing.Point(741, 237); this.groupBox2.Name = "groupBox2"; @@ -478,20 +477,20 @@ private void InitializeComponent() this.label4.TabIndex = 4; this.label4.Text = "Description: "; // - // printingListBox + // itemPrintingListBox // - this.printingListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.itemPrintingListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.printingListBox.FormattingEnabled = true; - this.printingListBox.ItemHeight = 28; - this.printingListBox.Items.AddRange(new object[] { + this.itemPrintingListBox.FormattingEnabled = true; + this.itemPrintingListBox.ItemHeight = 28; + this.itemPrintingListBox.Items.AddRange(new object[] { "Cold", "Hot"}); - this.printingListBox.Location = new System.Drawing.Point(166, 399); - this.printingListBox.Name = "printingListBox"; - this.printingListBox.Size = new System.Drawing.Size(418, 32); - this.printingListBox.Sorted = true; - this.printingListBox.TabIndex = 3; + this.itemPrintingListBox.Location = new System.Drawing.Point(166, 399); + this.itemPrintingListBox.Name = "itemPrintingListBox"; + this.itemPrintingListBox.Size = new System.Drawing.Size(418, 32); + this.itemPrintingListBox.Sorted = true; + this.itemPrintingListBox.TabIndex = 3; // // label3 // @@ -509,24 +508,24 @@ private void InitializeComponent() this.label2.TabIndex = 1; this.label2.Text = "Category:"; // - // categoryListBox + // itemCategoryListBox // - this.categoryListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.itemCategoryListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.categoryListBox.FormattingEnabled = true; - this.categoryListBox.ItemHeight = 28; - this.categoryListBox.Items.AddRange(new object[] { + this.itemCategoryListBox.FormattingEnabled = true; + this.itemCategoryListBox.ItemHeight = 28; + this.itemCategoryListBox.Items.AddRange(new object[] { "Appitizer", "Dessert", "Drink", "Entre", "Other"}); - this.categoryListBox.Location = new System.Drawing.Point(166, 236); - this.categoryListBox.Name = "categoryListBox"; - this.categoryListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; - this.categoryListBox.Size = new System.Drawing.Size(418, 116); - this.categoryListBox.Sorted = true; - this.categoryListBox.TabIndex = 0; + this.itemCategoryListBox.Location = new System.Drawing.Point(166, 236); + this.itemCategoryListBox.Name = "itemCategoryListBox"; + this.itemCategoryListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; + this.itemCategoryListBox.Size = new System.Drawing.Size(418, 116); + this.itemCategoryListBox.Sorted = true; + this.itemCategoryListBox.TabIndex = 0; // // groupBox3 // @@ -668,25 +667,23 @@ private void InitializeComponent() "Item3"}); this.employeeListBox.Location = new System.Drawing.Point(7, 69); this.employeeListBox.Name = "employeeListBox"; - this.employeeListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; this.employeeListBox.Size = new System.Drawing.Size(696, 650); this.employeeListBox.TabIndex = 16; + this.employeeListBox.SelectedIndexChanged += new System.EventHandler(this.employeeListBox_SelectedIndexChanged); // // groupBox6 // this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox6.BackColor = System.Drawing.Color.Transparent; - this.groupBox6.Controls.Add(this.lastNameTextBox); + this.groupBox6.Controls.Add(this.employeeLastNameTextBox); this.groupBox6.Controls.Add(this.label11); - this.groupBox6.Controls.Add(this.firstNameTextBox); + this.groupBox6.Controls.Add(this.employeeFirstNameTextBox); this.groupBox6.Controls.Add(this.label10); - this.groupBox6.Controls.Add(this.pinNumber); - this.groupBox6.Controls.Add(this.usernameTextBox); + this.groupBox6.Controls.Add(this.employeePinNumber); this.groupBox6.Controls.Add(this.pin); - this.groupBox6.Controls.Add(this.label9); this.groupBox6.Controls.Add(this.label7); - this.groupBox6.Controls.Add(this.listBox2); + this.groupBox6.Controls.Add(this.employeeRoleListBox); this.groupBox6.Font = new System.Drawing.Font("Segoe UI Light", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.groupBox6.Location = new System.Drawing.Point(741, 287); this.groupBox6.Name = "groupBox6"; @@ -696,185 +693,141 @@ private void InitializeComponent() this.groupBox6.TabStop = false; this.groupBox6.Text = "Options"; // - // lastNameTextBox + // employeeLastNameTextBox // - this.lastNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.employeeLastNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); // // // - this.lastNameTextBox.CustomButton.Image = null; - this.lastNameTextBox.CustomButton.Location = new System.Drawing.Point(384, 2); - this.lastNameTextBox.CustomButton.Name = ""; - this.lastNameTextBox.CustomButton.Size = new System.Drawing.Size(31, 31); - this.lastNameTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; - this.lastNameTextBox.CustomButton.TabIndex = 1; - this.lastNameTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; - this.lastNameTextBox.CustomButton.UseSelectable = true; - this.lastNameTextBox.CustomButton.Visible = false; - this.lastNameTextBox.FontSize = MetroFramework.MetroTextBoxSize.Medium; - this.lastNameTextBox.Lines = new string[] { + this.employeeLastNameTextBox.CustomButton.Image = null; + this.employeeLastNameTextBox.CustomButton.Location = new System.Drawing.Point(384, 2); + this.employeeLastNameTextBox.CustomButton.Name = ""; + this.employeeLastNameTextBox.CustomButton.Size = new System.Drawing.Size(31, 31); + this.employeeLastNameTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.employeeLastNameTextBox.CustomButton.TabIndex = 1; + this.employeeLastNameTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.employeeLastNameTextBox.CustomButton.UseSelectable = true; + this.employeeLastNameTextBox.CustomButton.Visible = false; + this.employeeLastNameTextBox.FontSize = MetroFramework.MetroTextBoxSize.Medium; + this.employeeLastNameTextBox.Lines = new string[] { "metroTextBox2"}; - this.lastNameTextBox.Location = new System.Drawing.Point(166, 131); - this.lastNameTextBox.MaxLength = 32767; - this.lastNameTextBox.Multiline = true; - this.lastNameTextBox.Name = "lastNameTextBox"; - this.lastNameTextBox.PasswordChar = '\0'; - this.lastNameTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; - this.lastNameTextBox.SelectedText = ""; - this.lastNameTextBox.SelectionLength = 0; - this.lastNameTextBox.SelectionStart = 0; - this.lastNameTextBox.ShortcutsEnabled = true; - this.lastNameTextBox.Size = new System.Drawing.Size(418, 36); - this.lastNameTextBox.TabIndex = 17; - this.lastNameTextBox.Text = "metroTextBox2"; - this.lastNameTextBox.UseSelectable = true; - this.lastNameTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); - this.lastNameTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + this.employeeLastNameTextBox.Location = new System.Drawing.Point(166, 83); + this.employeeLastNameTextBox.MaxLength = 32767; + this.employeeLastNameTextBox.Multiline = true; + this.employeeLastNameTextBox.Name = "employeeLastNameTextBox"; + this.employeeLastNameTextBox.PasswordChar = '\0'; + this.employeeLastNameTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.employeeLastNameTextBox.SelectedText = ""; + this.employeeLastNameTextBox.SelectionLength = 0; + this.employeeLastNameTextBox.SelectionStart = 0; + this.employeeLastNameTextBox.ShortcutsEnabled = true; + this.employeeLastNameTextBox.Size = new System.Drawing.Size(418, 36); + this.employeeLastNameTextBox.TabIndex = 17; + this.employeeLastNameTextBox.Text = "metroTextBox2"; + this.employeeLastNameTextBox.UseSelectable = true; + this.employeeLastNameTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.employeeLastNameTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); // // label11 // - this.label11.Location = new System.Drawing.Point(6, 131); + this.label11.Location = new System.Drawing.Point(6, 83); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(154, 36); this.label11.TabIndex = 16; this.label11.Text = "Last Name:"; // - // firstNameTextBox + // employeeFirstNameTextBox // - this.firstNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.employeeFirstNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); // // // - this.firstNameTextBox.CustomButton.Image = null; - this.firstNameTextBox.CustomButton.Location = new System.Drawing.Point(384, 2); - this.firstNameTextBox.CustomButton.Name = ""; - this.firstNameTextBox.CustomButton.Size = new System.Drawing.Size(31, 31); - this.firstNameTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; - this.firstNameTextBox.CustomButton.TabIndex = 1; - this.firstNameTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; - this.firstNameTextBox.CustomButton.UseSelectable = true; - this.firstNameTextBox.CustomButton.Visible = false; - this.firstNameTextBox.FontSize = MetroFramework.MetroTextBoxSize.Medium; - this.firstNameTextBox.Lines = new string[] { + this.employeeFirstNameTextBox.CustomButton.Image = null; + this.employeeFirstNameTextBox.CustomButton.Location = new System.Drawing.Point(384, 2); + this.employeeFirstNameTextBox.CustomButton.Name = ""; + this.employeeFirstNameTextBox.CustomButton.Size = new System.Drawing.Size(31, 31); + this.employeeFirstNameTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.employeeFirstNameTextBox.CustomButton.TabIndex = 1; + this.employeeFirstNameTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.employeeFirstNameTextBox.CustomButton.UseSelectable = true; + this.employeeFirstNameTextBox.CustomButton.Visible = false; + this.employeeFirstNameTextBox.FontSize = MetroFramework.MetroTextBoxSize.Medium; + this.employeeFirstNameTextBox.Lines = new string[] { "metroTextBox1"}; - this.firstNameTextBox.Location = new System.Drawing.Point(166, 83); - this.firstNameTextBox.MaxLength = 32767; - this.firstNameTextBox.Multiline = true; - this.firstNameTextBox.Name = "firstNameTextBox"; - this.firstNameTextBox.PasswordChar = '\0'; - this.firstNameTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; - this.firstNameTextBox.SelectedText = ""; - this.firstNameTextBox.SelectionLength = 0; - this.firstNameTextBox.SelectionStart = 0; - this.firstNameTextBox.ShortcutsEnabled = true; - this.firstNameTextBox.Size = new System.Drawing.Size(418, 36); - this.firstNameTextBox.TabIndex = 15; - this.firstNameTextBox.Text = "metroTextBox1"; - this.firstNameTextBox.UseSelectable = true; - this.firstNameTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); - this.firstNameTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + this.employeeFirstNameTextBox.Location = new System.Drawing.Point(166, 35); + this.employeeFirstNameTextBox.MaxLength = 32767; + this.employeeFirstNameTextBox.Multiline = true; + this.employeeFirstNameTextBox.Name = "employeeFirstNameTextBox"; + this.employeeFirstNameTextBox.PasswordChar = '\0'; + this.employeeFirstNameTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.employeeFirstNameTextBox.SelectedText = ""; + this.employeeFirstNameTextBox.SelectionLength = 0; + this.employeeFirstNameTextBox.SelectionStart = 0; + this.employeeFirstNameTextBox.ShortcutsEnabled = true; + this.employeeFirstNameTextBox.Size = new System.Drawing.Size(418, 36); + this.employeeFirstNameTextBox.TabIndex = 15; + this.employeeFirstNameTextBox.Text = "metroTextBox1"; + this.employeeFirstNameTextBox.UseSelectable = true; + this.employeeFirstNameTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.employeeFirstNameTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); // // label10 // - this.label10.Location = new System.Drawing.Point(6, 83); + this.label10.Location = new System.Drawing.Point(6, 35); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(154, 36); this.label10.TabIndex = 14; this.label10.Text = "First Name:"; // - // pinNumber + // employeePinNumber // - this.pinNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.employeePinNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.pinNumber.Location = new System.Drawing.Point(166, 187); - this.pinNumber.Maximum = new decimal(new int[] { + this.employeePinNumber.Location = new System.Drawing.Point(166, 139); + this.employeePinNumber.Maximum = new decimal(new int[] { 9999, 0, 0, 0}); - this.pinNumber.Name = "pinNumber"; - this.pinNumber.Size = new System.Drawing.Size(125, 34); - this.pinNumber.TabIndex = 13; - // - // usernameTextBox - // - this.usernameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - // - // - // - this.usernameTextBox.CustomButton.Image = null; - this.usernameTextBox.CustomButton.Location = new System.Drawing.Point(384, 2); - this.usernameTextBox.CustomButton.Name = ""; - this.usernameTextBox.CustomButton.Size = new System.Drawing.Size(31, 31); - this.usernameTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; - this.usernameTextBox.CustomButton.TabIndex = 1; - this.usernameTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; - this.usernameTextBox.CustomButton.UseSelectable = true; - this.usernameTextBox.CustomButton.Visible = false; - this.usernameTextBox.FontSize = MetroFramework.MetroTextBoxSize.Medium; - this.usernameTextBox.Lines = new string[] { - "metroTextBox1"}; - this.usernameTextBox.Location = new System.Drawing.Point(166, 35); - this.usernameTextBox.MaxLength = 32767; - this.usernameTextBox.Multiline = true; - this.usernameTextBox.Name = "usernameTextBox"; - this.usernameTextBox.PasswordChar = '\0'; - this.usernameTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; - this.usernameTextBox.SelectedText = ""; - this.usernameTextBox.SelectionLength = 0; - this.usernameTextBox.SelectionStart = 0; - this.usernameTextBox.ShortcutsEnabled = true; - this.usernameTextBox.Size = new System.Drawing.Size(418, 36); - this.usernameTextBox.TabIndex = 12; - this.usernameTextBox.Text = "metroTextBox1"; - this.usernameTextBox.UseSelectable = true; - this.usernameTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); - this.usernameTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + this.employeePinNumber.Name = "employeePinNumber"; + this.employeePinNumber.Size = new System.Drawing.Size(125, 34); + this.employeePinNumber.TabIndex = 13; // // pin // - this.pin.Location = new System.Drawing.Point(6, 183); + this.pin.Location = new System.Drawing.Point(6, 135); this.pin.Name = "pin"; this.pin.Size = new System.Drawing.Size(154, 36); this.pin.TabIndex = 11; this.pin.Text = "Pin:"; // - // label9 - // - this.label9.Location = new System.Drawing.Point(6, 35); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(154, 36); - this.label9.TabIndex = 10; - this.label9.Text = "Username:"; - // // label7 // - this.label7.Location = new System.Drawing.Point(6, 237); + this.label7.Location = new System.Drawing.Point(6, 189); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(154, 36); this.label7.TabIndex = 1; this.label7.Text = "Roles:"; // - // listBox2 + // employeeRoleListBox // - this.listBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.employeeRoleListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.listBox2.FormattingEnabled = true; - this.listBox2.ItemHeight = 28; - this.listBox2.Items.AddRange(new object[] { + this.employeeRoleListBox.FormattingEnabled = true; + this.employeeRoleListBox.ItemHeight = 28; + this.employeeRoleListBox.Items.AddRange(new object[] { "Admin", "Chef", "Host", "Waiter"}); - this.listBox2.Location = new System.Drawing.Point(166, 237); - this.listBox2.Name = "listBox2"; - this.listBox2.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; - this.listBox2.Size = new System.Drawing.Size(418, 88); - this.listBox2.TabIndex = 0; + this.employeeRoleListBox.Location = new System.Drawing.Point(166, 189); + this.employeeRoleListBox.Name = "employeeRoleListBox"; + this.employeeRoleListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; + this.employeeRoleListBox.Size = new System.Drawing.Size(418, 116); + this.employeeRoleListBox.TabIndex = 0; // // groupBox7 // @@ -1002,7 +955,6 @@ private void InitializeComponent() "Item3"}); this.stationListBox.Location = new System.Drawing.Point(7, 69); this.stationListBox.Name = "stationListBox"; - this.stationListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; this.stationListBox.Size = new System.Drawing.Size(696, 650); this.stationListBox.TabIndex = 10; // @@ -1125,7 +1077,7 @@ private void InitializeComponent() this.Load += new System.EventHandler(this.AdminStationView_Load); this.adminTabControl.ResumeLayout(false); this.menuTab.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); + this.menuOptions.ResumeLayout(false); this.menuGroup1.ResumeLayout(false); this.itemsTab.ResumeLayout(false); this.groupBox2.ResumeLayout(false); @@ -1133,7 +1085,7 @@ private void InitializeComponent() this.groupBox3.ResumeLayout(false); this.employeeTab.ResumeLayout(false); this.groupBox6.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pinNumber)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.employeePinNumber)).EndInit(); this.groupBox7.ResumeLayout(false); this.stationTab.ResumeLayout(false); this.groupBox4.ResumeLayout(false); @@ -1153,20 +1105,20 @@ private void InitializeComponent() private MetroFramework.Controls.MetroButton metroButton2; private MetroFramework.Controls.MetroButton metroButton1; private MetroFramework.Controls.MetroButton metroButton3; - private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox menuOptions; private System.Windows.Forms.ListBox displayedOnDevices; private System.Windows.Forms.Label label1; private MetroFramework.Controls.MetroTabPage stationTab; private System.Windows.Forms.ListBox menuItemListBox; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.Label label2; - private System.Windows.Forms.ListBox categoryListBox; + private System.Windows.Forms.ListBox itemCategoryListBox; private System.Windows.Forms.GroupBox groupBox3; private MetroFramework.Controls.MetroButton removeItemButton; private MetroFramework.Controls.MetroButton renameItemButton; private MetroFramework.Controls.MetroButton addItemButton; private MetroFramework.Controls.MetroLabel metroLabel2; - private System.Windows.Forms.ListBox printingListBox; + private System.Windows.Forms.ListBox itemPrintingListBox; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; private MetroFramework.Controls.MetroTextBox itemDescriptionTextbox; @@ -1192,19 +1144,17 @@ private void InitializeComponent() private System.Windows.Forms.ListBox employeeListBox; private System.Windows.Forms.GroupBox groupBox6; private System.Windows.Forms.Label label7; - private System.Windows.Forms.ListBox listBox2; + private System.Windows.Forms.ListBox employeeRoleListBox; private System.Windows.Forms.GroupBox groupBox7; private MetroFramework.Controls.MetroButton employeeRemoveButton; private MetroFramework.Controls.MetroButton employeeAddButton; private MetroFramework.Controls.MetroLabel metroLabel4; - private MetroFramework.Controls.MetroTextBox lastNameTextBox; + private MetroFramework.Controls.MetroTextBox employeeLastNameTextBox; private System.Windows.Forms.Label label11; - private MetroFramework.Controls.MetroTextBox firstNameTextBox; + private MetroFramework.Controls.MetroTextBox employeeFirstNameTextBox; private System.Windows.Forms.Label label10; - private System.Windows.Forms.NumericUpDown pinNumber; - private MetroFramework.Controls.MetroTextBox usernameTextBox; + private System.Windows.Forms.NumericUpDown employeePinNumber; private System.Windows.Forms.Label pin; - private System.Windows.Forms.Label label9; private System.Windows.Forms.ListBox menuListBox; private System.Windows.Forms.ComboBox menuSelectionBox; } diff --git a/Enigma/StationsGUI/AdminStationView.cs b/Enigma/StationsGUI/AdminStationView.cs index 314f8a1..4cfe8c5 100644 --- a/Enigma/StationsGUI/AdminStationView.cs +++ b/Enigma/StationsGUI/AdminStationView.cs @@ -31,7 +31,7 @@ public AdminStationView(Employee loggedIn) private void AdminStationView_Load(object sender, EventArgs e) { loadAllData(); - drawAllData(); + // drawAllData(); } private void loadAllData() { @@ -55,11 +55,13 @@ private void drawMenus() { foreach (EnigmaMenu menu in enigmaMenus) { menuSelectionBox.Items.Add(menu); - foreach (EnigmaMenuItem item in menu.Items) { - menuListBox.Items.Add(item); - } + } + foreach (EnigmaMenuItem item in enigmaMenuItems) + { + menuListBox.Items.Add(item); + } } private void drawMenuItems() @@ -112,10 +114,10 @@ private void loadMenuItems() private void loadEmployees() { DBConnect db = new DBConnect(); - List> employees = db.ReadCommand("SELECT * FROM Users", "id", "username", "first", "last", "role", "pin"); + List> employees = db.ReadCommand("SELECT * FROM Users", "id", "first", "last", "role", "pin"); foreach (Dictionary row in employees) { - Employee employee = new Employee(Convert.ToInt32(row["id"]), row["username"], row["first"], row["last"], Employee.getRoles(row["role"]), Convert.ToInt32(row["pin"])); + Employee employee = new Employee(Convert.ToInt32(row["id"]), row["first"], row["last"], Employee.getRoles(row["role"]), Convert.ToInt32(row["pin"])); enigmaEmployees.Add(employee); } } @@ -133,16 +135,143 @@ private void loadStations() private void adminTabControl_SelectedIndexChanged(object sender, EventArgs e) { - switch (e.ToString()) { - + switch (adminTabControl.SelectedIndex) { + case 0: + drawMenus(); + break; + case 1: + drawMenuItems(); + break; + case 2: + drawEmployees(); + break; + case 3: + drawStations(); + break; + default: + + break; } } private void menuSelectionBox_SelectedIndexChanged(object sender, EventArgs e) { - if (menuSelectionBox.SelectedIndex != 0) { + openMenu(menuSelectionBox.SelectedIndex); + } + + private void openMenu(int id) { + EnigmaMenu menu = enigmaMenus[id]; + menuListBox.ClearSelected(); + + foreach (EnigmaMenuItem item in menu.Items) { + Predicate itemFinder = (EnigmaMenuItem p) => { return p.Id == item.Id; }; + menuListBox.SetSelected(enigmaMenuItems.FindIndex(itemFinder), true); + } + } + + private void openItem(int id) { + EnigmaMenuItem item = enigmaMenuItems[id]; + itemCategoryListBox.ClearSelected(); + itemDescriptionTextbox.ResetText(); + itemPrice.ResetText(); + itemPrintingListBox.ClearSelected(); + + itemPrice.Value = decimal.Parse(item.Price.ToString()); + itemDescriptionTextbox.Text = item.Description; + itemCategoryListBox.SetSelected(getItemCategoryId(item.ItemType), true); + itemPrintingListBox.SetSelected(getPrintingStationId(item.PrintingType), true); + } + + private void openEmployee(int id) { + Employee employee = enigmaEmployees[id]; + employeeFirstNameTextBox.ResetText(); + employeeLastNameTextBox.ResetText(); + employeePinNumber.ResetText(); + employeeRoleListBox.ClearSelected(); + + employeeFirstNameTextBox.Text = employee.FirstName; + employeeLastNameTextBox.Text = employee.LastName; + employeePinNumber.Value = employee.Pin; + + foreach (EmployeeRole role in employee.Roles) { } + + } + + private int getItemCategoryId(MenuItemType type) { + switch (type) { + case MenuItemType.appetizer: + return 0; + case MenuItemType.dessert: + return 1; + case MenuItemType.drink: + return 2; + case MenuItemType.entre: + return 3; + case MenuItemType.other: + return 4; + default: + return 0; + } + } + + private MenuItemType getItemCategoryEnum(int id) { + switch (id) { + case 0: + return MenuItemType.appetizer; + case 1: + return MenuItemType.dessert; + case 2: + return MenuItemType.drink; + case 3: + return MenuItemType.entre; + case 4: + return MenuItemType.other; + default: + return MenuItemType.other; + } + } + + private int getPrintingStationId(PrintingStationType type) + { + switch (type) + { + case PrintingStationType.cold: + return 0; + case PrintingStationType.hot: + return 1; + default: + return 0; + } + } + + private PrintingStationType getPrintingStationEnum(int id) + { + switch (id) + { + case 0: + return PrintingStationType.cold; + case 1: + return PrintingStationType.hot; + default: + return PrintingStationType.cold; + } + } + + private void menuTab_Click(object sender, EventArgs e) + { + + } + + private void menuItemListBox_SelectedIndexChanged(object sender, EventArgs e) + { + openItem(menuItemListBox.SelectedIndex); + } + + private void employeeListBox_SelectedIndexChanged(object sender, EventArgs e) + { + openEmployee(employeeListBox.SelectedIndex); } } } diff --git a/EnigmaX/Classes/Employee.cs b/EnigmaX/Classes/Employee.cs index 7ebd3bc..b4531cb 100644 --- a/EnigmaX/Classes/Employee.cs +++ b/EnigmaX/Classes/Employee.cs @@ -11,15 +11,13 @@ public class Employee { private int _id; - private string _username; private string _first; private string _last; private List _roles; private int _pin; - public Employee(int id, string username, string first, string last, List roles, int pin) { + public Employee(int id, string first, string last, List roles, int pin) { _id = id; - _username = username; _first = first; _last = last; _roles = roles; @@ -32,6 +30,44 @@ public int Id { } } + public string FirstName { + get { + return _first; + } + set { + _first = value; + } + } + + public string LastName { + get { + return _last; + } + set { + _last = value; + } + } + + public int Pin + { + get { + return _pin; + } + set { + _pin = value; + } + + } + + public List Roles { + get { + return _roles; + } + set { + _roles = value; + } + } + public static Employee getEmployeeWithPin(string pin) { @@ -41,10 +77,10 @@ public static Employee getEmployeeWithPin(string pin) } DBConnect db = new DBConnect(); - List> result = db.ReadCommand("SELECT * FROM Users WHERE pin='" + pin + "' LIMIT 1", "id", "username", "first", "last", "role"); + List> result = db.ReadCommand("SELECT * FROM Users WHERE pin='" + pin + "' LIMIT 1", "id", "first", "last", "role"); if (result.Count == 1) { - return new Employee(Convert.ToInt32(result[0]["id"]), result[0]["username"], result[0]["first"], result[0]["last"], getRoles(result[0]["role"]), Convert.ToInt32(pin)); + return new Employee(Convert.ToInt32(result[0]["id"]), result[0]["first"], result[0]["last"], getRoles(result[0]["role"]), Convert.ToInt32(pin)); } else { return null; diff --git a/EnigmaX/Classes/EnigmaMenuItem.cs b/EnigmaX/Classes/EnigmaMenuItem.cs index ae6ee7a..bbb139e 100644 --- a/EnigmaX/Classes/EnigmaMenuItem.cs +++ b/EnigmaX/Classes/EnigmaMenuItem.cs @@ -37,6 +37,44 @@ public int Id { } } + public string Description { + get { + return _description; + } + set { + _description = value; + } + } + + public float Price { + get { + return _price; + } + set { + _price = value; + } + } + + public MenuItemType ItemType + { + get { + return _itemType; + } + set { + _itemType = value; + } + + } + + public PrintingStationType PrintingType { + get { + return _printingType; + } + set { + _printingType = value; + } + } + public string Title { get { return _title; @@ -51,7 +89,7 @@ public static EnigmaMenuItem idToMenuItem(int id) DBConnect db = new DBConnect(); MySqlCommand conn = new MySqlCommand("SELECT * FROM MenuItems WHERE id = @id LIMIT 1"); conn.Parameters.AddWithValue("@id", id.ToString()); - List> result = db.ReadCommand(conn, "title", "title", "description", "price", "category", "printingStation"); + List> result = db.ReadCommand(conn, "title", "description", "price", "category", "printingStation"); if (result.Count > 0) { return new EnigmaMenuItem(id, result[0]["title"], result[0]["description"], float.Parse(result[0]["price"]), (MenuItemType)Enum.Parse(typeof(MenuItemType), result[0]["category"]), (PrintingStationType)Enum.Parse(typeof(PrintingStationType), result[0]["printingStation"]));