diff --git a/Enigma/Enigma.csproj b/Enigma/Enigma.csproj index 741c3e2..ef8a303 100644 --- a/Enigma/Enigma.csproj +++ b/Enigma/Enigma.csproj @@ -62,6 +62,12 @@ + + Form + + + AddPopup.cs + Form @@ -122,6 +128,9 @@ + + AddPopup.cs + resAdd.cs diff --git a/Enigma/Popups/AddPopup.Designer.cs b/Enigma/Popups/AddPopup.Designer.cs new file mode 100644 index 0000000..624c89d --- /dev/null +++ b/Enigma/Popups/AddPopup.Designer.cs @@ -0,0 +1,131 @@ +namespace Enigma.Popups +{ + partial class AddPopup + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.value1Textbox = new MetroFramework.Controls.MetroTextBox(); + this.value1Name = new System.Windows.Forms.Label(); + this.addButton = new MetroFramework.Controls.MetroButton(); + this.cancelButton = new MetroFramework.Controls.MetroButton(); + this.SuspendLayout(); + // + // value1Textbox + // + this.value1Textbox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + // + // + // + this.value1Textbox.CustomButton.Image = null; + this.value1Textbox.CustomButton.Location = new System.Drawing.Point(530, 2); + this.value1Textbox.CustomButton.Name = ""; + this.value1Textbox.CustomButton.Size = new System.Drawing.Size(31, 31); + this.value1Textbox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.value1Textbox.CustomButton.TabIndex = 1; + this.value1Textbox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.value1Textbox.CustomButton.UseSelectable = true; + this.value1Textbox.CustomButton.Visible = false; + this.value1Textbox.FontSize = MetroFramework.MetroTextBoxSize.Medium; + this.value1Textbox.Lines = new string[] { + "metroTextBox1"}; + this.value1Textbox.Location = new System.Drawing.Point(183, 60); + this.value1Textbox.MaxLength = 32767; + this.value1Textbox.Multiline = true; + this.value1Textbox.Name = "value1Textbox"; + this.value1Textbox.PasswordChar = '\0'; + this.value1Textbox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.value1Textbox.SelectedText = ""; + this.value1Textbox.SelectionLength = 0; + this.value1Textbox.SelectionStart = 0; + this.value1Textbox.ShortcutsEnabled = true; + this.value1Textbox.Size = new System.Drawing.Size(564, 36); + this.value1Textbox.TabIndex = 19; + this.value1Textbox.Text = "metroTextBox1"; + this.value1Textbox.UseSelectable = true; + this.value1Textbox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.value1Textbox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + this.value1Textbox.Click += new System.EventHandler(this.value1Textbox_Click); + // + // value1Name + // + this.value1Name.Font = new System.Drawing.Font("Segoe UI Light", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.value1Name.Location = new System.Drawing.Point(23, 60); + this.value1Name.Name = "value1Name"; + this.value1Name.Size = new System.Drawing.Size(154, 36); + this.value1Name.TabIndex = 18; + this.value1Name.Text = "Menu Title:"; + // + // addButton + // + this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.addButton.FontSize = MetroFramework.MetroButtonSize.Tall; + this.addButton.FontWeight = MetroFramework.MetroButtonWeight.Regular; + this.addButton.Location = new System.Drawing.Point(585, 114); + this.addButton.Name = "addButton"; + this.addButton.Size = new System.Drawing.Size(162, 45); + this.addButton.TabIndex = 21; + this.addButton.Text = "Add"; + this.addButton.UseSelectable = true; + this.addButton.Click += new System.EventHandler(this.addButton_Click); + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.FontSize = MetroFramework.MetroButtonSize.Tall; + this.cancelButton.FontWeight = MetroFramework.MetroButtonWeight.Regular; + this.cancelButton.Location = new System.Drawing.Point(432, 114); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(147, 45); + this.cancelButton.TabIndex = 20; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseSelectable = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // AddPopup + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.ClientSize = new System.Drawing.Size(770, 182); + this.Controls.Add(this.addButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.value1Textbox); + this.Controls.Add(this.value1Name); + this.Name = "AddPopup"; + this.Text = "Add"; + this.Load += new System.EventHandler(this.AddPopup_Load); + this.ResumeLayout(false); + + } + + #endregion + + private MetroFramework.Controls.MetroTextBox value1Textbox; + private System.Windows.Forms.Label value1Name; + private MetroFramework.Controls.MetroButton addButton; + private MetroFramework.Controls.MetroButton cancelButton; + } +} \ No newline at end of file diff --git a/Enigma/Popups/AddPopup.cs b/Enigma/Popups/AddPopup.cs new file mode 100644 index 0000000..e526cce --- /dev/null +++ b/Enigma/Popups/AddPopup.cs @@ -0,0 +1,47 @@ +using MetroFramework.Forms; +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 Enigma.Popups +{ + public partial class AddPopup : MetroForm + { + public AddPopup(string title, string name) + { + InitializeComponent(); + this.Text = "Add " + title; + value1Name.Text = name; + } + public string returnValue = ""; + private void AddPopup_Load(object sender, EventArgs e) + { + + } + + private void addButton_Click(object sender, EventArgs e) + { + returnValue = value1Textbox.Text; + MessageBox.Show(returnValue); + DialogResult = DialogResult.OK; + Close(); + } + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + private void value1Textbox_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/Enigma/Popups/AddPopup.resx b/Enigma/Popups/AddPopup.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Enigma/Popups/AddPopup.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Enigma/StationsGUI/AdminStationView.Designer.cs b/Enigma/StationsGUI/AdminStationView.Designer.cs index 67f8af9..e86ec65 100644 --- a/Enigma/StationsGUI/AdminStationView.Designer.cs +++ b/Enigma/StationsGUI/AdminStationView.Designer.cs @@ -36,10 +36,9 @@ private void InitializeComponent() this.menuRevertButton = new MetroFramework.Controls.MetroButton(); this.menuOptions = new System.Windows.Forms.GroupBox(); this.label1 = new System.Windows.Forms.Label(); - this.displayedOnDevices = new System.Windows.Forms.ListBox(); + this.menuDisplayedOnListBox = new System.Windows.Forms.ListBox(); this.menuGroup1 = new System.Windows.Forms.GroupBox(); this.metroButton3 = new MetroFramework.Controls.MetroButton(); - this.metroButton2 = new MetroFramework.Controls.MetroButton(); this.metroButton1 = new MetroFramework.Controls.MetroButton(); this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); this.itemsTab = new MetroFramework.Controls.MetroTabPage(); @@ -57,7 +56,6 @@ private void InitializeComponent() 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(); this.addItemButton = new MetroFramework.Controls.MetroButton(); this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); this.employeeTab = new MetroFramework.Controls.MetroTabPage(); @@ -86,9 +84,12 @@ private void InitializeComponent() this.stationTypeListBox = new System.Windows.Forms.ListBox(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.stationRemoveButton = new MetroFramework.Controls.MetroButton(); - this.stationRenameButton = new MetroFramework.Controls.MetroButton(); this.stationAddButton = new MetroFramework.Controls.MetroButton(); this.metroLabel3 = new MetroFramework.Controls.MetroLabel(); + this.itemNameTextBox = new MetroFramework.Controls.MetroTextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.menuTitleTextBox = new MetroFramework.Controls.MetroTextBox(); + this.label12 = new System.Windows.Forms.Label(); this.adminTabControl.SuspendLayout(); this.menuTab.SuspendLayout(); this.menuOptions.SuspendLayout(); @@ -117,7 +118,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 = 2; + this.adminTabControl.SelectedIndex = 3; this.adminTabControl.Size = new System.Drawing.Size(1368, 832); this.adminTabControl.TabIndex = 0; this.adminTabControl.UseSelectable = true; @@ -178,7 +179,7 @@ private void InitializeComponent() "Item3"}); this.menuListBox.Location = new System.Drawing.Point(8, 69); this.menuListBox.Name = "menuListBox"; - this.menuListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; + this.menuListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; this.menuListBox.Size = new System.Drawing.Size(696, 650); this.menuListBox.TabIndex = 11; // @@ -193,6 +194,7 @@ private void InitializeComponent() this.menuSaveButton.TabIndex = 9; this.menuSaveButton.Text = "Save"; this.menuSaveButton.UseSelectable = true; + this.menuSaveButton.Click += new System.EventHandler(this.menuSaveButton_Click); // // menuRevertButton // @@ -211,8 +213,10 @@ private void InitializeComponent() this.menuOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.menuOptions.BackColor = System.Drawing.Color.Transparent; + this.menuOptions.Controls.Add(this.menuTitleTextBox); + this.menuOptions.Controls.Add(this.label12); this.menuOptions.Controls.Add(this.label1); - this.menuOptions.Controls.Add(this.displayedOnDevices); + this.menuOptions.Controls.Add(this.menuDisplayedOnListBox); 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"; @@ -224,37 +228,36 @@ private void InitializeComponent() // // label1 // - this.label1.Location = new System.Drawing.Point(6, 35); + this.label1.Location = new System.Drawing.Point(6, 119); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(171, 36); this.label1.TabIndex = 1; this.label1.Text = "Display Menu On:"; // - // displayedOnDevices + // menuDisplayedOnListBox // - this.displayedOnDevices.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.menuDisplayedOnListBox.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.displayedOnDevices.FormattingEnabled = true; - this.displayedOnDevices.ItemHeight = 28; - this.displayedOnDevices.Items.AddRange(new object[] { + this.menuDisplayedOnListBox.FormattingEnabled = true; + this.menuDisplayedOnListBox.ItemHeight = 28; + this.menuDisplayedOnListBox.Items.AddRange(new object[] { "Computer1", "Computer2", "Computer3", "Computer4"}); - this.displayedOnDevices.Location = new System.Drawing.Point(183, 35); - this.displayedOnDevices.Name = "displayedOnDevices"; - this.displayedOnDevices.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; - this.displayedOnDevices.Size = new System.Drawing.Size(401, 340); - this.displayedOnDevices.Sorted = true; - this.displayedOnDevices.TabIndex = 0; + this.menuDisplayedOnListBox.Location = new System.Drawing.Point(183, 119); + this.menuDisplayedOnListBox.Name = "menuDisplayedOnListBox"; + this.menuDisplayedOnListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; + this.menuDisplayedOnListBox.Size = new System.Drawing.Size(401, 256); + this.menuDisplayedOnListBox.Sorted = true; + this.menuDisplayedOnListBox.TabIndex = 0; // // menuGroup1 // this.menuGroup1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.menuGroup1.BackColor = System.Drawing.Color.Transparent; this.menuGroup1.Controls.Add(this.metroButton3); - this.menuGroup1.Controls.Add(this.metroButton2); this.menuGroup1.Controls.Add(this.metroButton1); this.menuGroup1.Font = new System.Drawing.Font("Segoe UI Light", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.menuGroup1.Location = new System.Drawing.Point(741, 63); @@ -271,26 +274,13 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.metroButton3.FontSize = MetroFramework.MetroButtonSize.Tall; this.metroButton3.FontWeight = MetroFramework.MetroButtonWeight.Regular; - this.metroButton3.Location = new System.Drawing.Point(397, 30); + this.metroButton3.Location = new System.Drawing.Point(297, 30); this.metroButton3.Name = "metroButton3"; - this.metroButton3.Size = new System.Drawing.Size(187, 177); + this.metroButton3.Size = new System.Drawing.Size(287, 177); this.metroButton3.TabIndex = 6; this.metroButton3.Text = "Remove Menu"; this.metroButton3.UseSelectable = true; // - // metroButton2 - // - this.metroButton2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.metroButton2.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton2.FontWeight = MetroFramework.MetroButtonWeight.Regular; - this.metroButton2.Location = new System.Drawing.Point(204, 30); - this.metroButton2.Name = "metroButton2"; - this.metroButton2.Size = new System.Drawing.Size(187, 177); - this.metroButton2.TabIndex = 5; - this.metroButton2.Text = "Rename Menu"; - this.metroButton2.UseSelectable = true; - // // metroButton1 // this.metroButton1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -299,10 +289,11 @@ private void InitializeComponent() this.metroButton1.FontWeight = MetroFramework.MetroButtonWeight.Regular; this.metroButton1.Location = new System.Drawing.Point(11, 30); this.metroButton1.Name = "metroButton1"; - this.metroButton1.Size = new System.Drawing.Size(187, 177); + this.metroButton1.Size = new System.Drawing.Size(280, 177); this.metroButton1.TabIndex = 4; this.metroButton1.Text = "Add Menu"; this.metroButton1.UseSelectable = true; + this.metroButton1.Click += new System.EventHandler(this.metroButton1_Click); // // metroLabel1 // @@ -347,6 +338,7 @@ private void InitializeComponent() this.itemsSaveButton.TabIndex = 11; this.itemsSaveButton.Text = "Save"; this.itemsSaveButton.UseSelectable = true; + this.itemsSaveButton.Click += new System.EventHandler(this.itemsSaveButton_Click); // // menuItemListBox // @@ -398,6 +390,8 @@ private void InitializeComponent() this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox2.BackColor = System.Drawing.Color.Transparent; + this.groupBox2.Controls.Add(this.itemNameTextBox); + this.groupBox2.Controls.Add(this.label9); this.groupBox2.Controls.Add(this.itemPrice); this.groupBox2.Controls.Add(this.itemDescriptionTextbox); this.groupBox2.Controls.Add(this.label5); @@ -433,9 +427,9 @@ private void InitializeComponent() // // this.itemDescriptionTextbox.CustomButton.Image = null; - this.itemDescriptionTextbox.CustomButton.Location = new System.Drawing.Point(278, 1); + this.itemDescriptionTextbox.CustomButton.Location = new System.Drawing.Point(336, 1); this.itemDescriptionTextbox.CustomButton.Name = ""; - this.itemDescriptionTextbox.CustomButton.Size = new System.Drawing.Size(139, 139); + this.itemDescriptionTextbox.CustomButton.Size = new System.Drawing.Size(81, 81); this.itemDescriptionTextbox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; this.itemDescriptionTextbox.CustomButton.TabIndex = 1; this.itemDescriptionTextbox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; @@ -444,7 +438,7 @@ private void InitializeComponent() this.itemDescriptionTextbox.FontSize = MetroFramework.MetroTextBoxSize.Medium; this.itemDescriptionTextbox.Lines = new string[] { "metroTextBox1"}; - this.itemDescriptionTextbox.Location = new System.Drawing.Point(166, 35); + this.itemDescriptionTextbox.Location = new System.Drawing.Point(166, 93); this.itemDescriptionTextbox.MaxLength = 32767; this.itemDescriptionTextbox.Multiline = true; this.itemDescriptionTextbox.Name = "itemDescriptionTextbox"; @@ -454,7 +448,7 @@ private void InitializeComponent() this.itemDescriptionTextbox.SelectionLength = 0; this.itemDescriptionTextbox.SelectionStart = 0; this.itemDescriptionTextbox.ShortcutsEnabled = true; - this.itemDescriptionTextbox.Size = new System.Drawing.Size(418, 141); + this.itemDescriptionTextbox.Size = new System.Drawing.Size(418, 83); this.itemDescriptionTextbox.TabIndex = 6; this.itemDescriptionTextbox.Text = "metroTextBox1"; this.itemDescriptionTextbox.UseSelectable = true; @@ -471,7 +465,7 @@ private void InitializeComponent() // // label4 // - this.label4.Location = new System.Drawing.Point(6, 35); + this.label4.Location = new System.Drawing.Point(6, 93); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(154, 36); this.label4.TabIndex = 4; @@ -488,7 +482,7 @@ private void InitializeComponent() "Hot"}); this.itemPrintingListBox.Location = new System.Drawing.Point(166, 399); this.itemPrintingListBox.Name = "itemPrintingListBox"; - this.itemPrintingListBox.Size = new System.Drawing.Size(418, 32); + this.itemPrintingListBox.Size = new System.Drawing.Size(418, 60); this.itemPrintingListBox.Sorted = true; this.itemPrintingListBox.TabIndex = 3; // @@ -523,7 +517,7 @@ private void InitializeComponent() 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.Size = new System.Drawing.Size(418, 144); this.itemCategoryListBox.Sorted = true; this.itemCategoryListBox.TabIndex = 0; // @@ -532,7 +526,6 @@ private void InitializeComponent() this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox3.BackColor = System.Drawing.Color.Transparent; this.groupBox3.Controls.Add(this.removeItemButton); - this.groupBox3.Controls.Add(this.renameItemButton); this.groupBox3.Controls.Add(this.addItemButton); this.groupBox3.Font = new System.Drawing.Font("Segoe UI Light", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.groupBox3.Location = new System.Drawing.Point(741, 63); @@ -549,26 +542,13 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.removeItemButton.FontSize = MetroFramework.MetroButtonSize.Tall; this.removeItemButton.FontWeight = MetroFramework.MetroButtonWeight.Regular; - this.removeItemButton.Location = new System.Drawing.Point(397, 30); + this.removeItemButton.Location = new System.Drawing.Point(297, 30); this.removeItemButton.Name = "removeItemButton"; - this.removeItemButton.Size = new System.Drawing.Size(187, 127); + this.removeItemButton.Size = new System.Drawing.Size(287, 127); this.removeItemButton.TabIndex = 6; - this.removeItemButton.Text = "Remove Item(s)"; + this.removeItemButton.Text = "Remove Item"; this.removeItemButton.UseSelectable = true; // - // renameItemButton - // - this.renameItemButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.renameItemButton.FontSize = MetroFramework.MetroButtonSize.Tall; - this.renameItemButton.FontWeight = MetroFramework.MetroButtonWeight.Regular; - this.renameItemButton.Location = new System.Drawing.Point(204, 30); - this.renameItemButton.Name = "renameItemButton"; - this.renameItemButton.Size = new System.Drawing.Size(187, 127); - this.renameItemButton.TabIndex = 5; - this.renameItemButton.Text = "Rename Item"; - this.renameItemButton.UseSelectable = true; - // // addItemButton // this.addItemButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -577,10 +557,11 @@ private void InitializeComponent() this.addItemButton.FontWeight = MetroFramework.MetroButtonWeight.Regular; this.addItemButton.Location = new System.Drawing.Point(11, 30); this.addItemButton.Name = "addItemButton"; - this.addItemButton.Size = new System.Drawing.Size(187, 127); + this.addItemButton.Size = new System.Drawing.Size(280, 127); this.addItemButton.TabIndex = 4; - this.addItemButton.Text = "Add Item(s)"; + this.addItemButton.Text = "Add Item"; this.addItemButton.UseSelectable = true; + this.addItemButton.Click += new System.EventHandler(this.addItemButton_Click); // // metroLabel2 // @@ -625,6 +606,7 @@ private void InitializeComponent() this.metroButton4.TabIndex = 21; this.metroButton4.Text = "Save"; this.metroButton4.UseSelectable = true; + this.metroButton4.Click += new System.EventHandler(this.metroButton4_Click); // // metroButton5 // @@ -869,6 +851,7 @@ private void InitializeComponent() this.employeeAddButton.TabIndex = 4; this.employeeAddButton.Text = "Add Employee"; this.employeeAddButton.UseSelectable = true; + this.employeeAddButton.Click += new System.EventHandler(this.employeeAddButton_Click); // // metroLabel4 // @@ -913,6 +896,7 @@ private void InitializeComponent() this.stationSaveButton.TabIndex = 15; this.stationSaveButton.Text = "Save"; this.stationSaveButton.UseSelectable = true; + this.stationSaveButton.Click += new System.EventHandler(this.stationSaveButton_Click); // // stationRevertButton // @@ -957,6 +941,7 @@ private void InitializeComponent() this.stationListBox.Name = "stationListBox"; this.stationListBox.Size = new System.Drawing.Size(696, 650); this.stationListBox.TabIndex = 10; + this.stationListBox.SelectedIndexChanged += new System.EventHandler(this.stationListBox_SelectedIndexChanged); // // groupBox4 // @@ -990,14 +975,13 @@ private void InitializeComponent() this.stationTypeListBox.FormattingEnabled = true; this.stationTypeListBox.ItemHeight = 28; this.stationTypeListBox.Items.AddRange(new object[] { - "Admin Station", "Chef Station", + "Waiter Station", "Host Station", - "Waiter Station"}); + "Admin Station"}); this.stationTypeListBox.Location = new System.Drawing.Point(183, 35); this.stationTypeListBox.Name = "stationTypeListBox"; this.stationTypeListBox.Size = new System.Drawing.Size(401, 340); - this.stationTypeListBox.Sorted = true; this.stationTypeListBox.TabIndex = 0; // // groupBox5 @@ -1005,7 +989,6 @@ private void InitializeComponent() this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox5.BackColor = System.Drawing.Color.Transparent; this.groupBox5.Controls.Add(this.stationRemoveButton); - this.groupBox5.Controls.Add(this.stationRenameButton); this.groupBox5.Controls.Add(this.stationAddButton); this.groupBox5.Font = new System.Drawing.Font("Segoe UI Light", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.groupBox5.Location = new System.Drawing.Point(741, 63); @@ -1022,26 +1005,13 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.stationRemoveButton.FontSize = MetroFramework.MetroButtonSize.Tall; this.stationRemoveButton.FontWeight = MetroFramework.MetroButtonWeight.Regular; - this.stationRemoveButton.Location = new System.Drawing.Point(397, 30); + this.stationRemoveButton.Location = new System.Drawing.Point(297, 30); this.stationRemoveButton.Name = "stationRemoveButton"; - this.stationRemoveButton.Size = new System.Drawing.Size(187, 177); + this.stationRemoveButton.Size = new System.Drawing.Size(287, 177); this.stationRemoveButton.TabIndex = 6; this.stationRemoveButton.Text = "Remove Station"; this.stationRemoveButton.UseSelectable = true; // - // stationRenameButton - // - this.stationRenameButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.stationRenameButton.FontSize = MetroFramework.MetroButtonSize.Tall; - this.stationRenameButton.FontWeight = MetroFramework.MetroButtonWeight.Regular; - this.stationRenameButton.Location = new System.Drawing.Point(204, 30); - this.stationRenameButton.Name = "stationRenameButton"; - this.stationRenameButton.Size = new System.Drawing.Size(187, 177); - this.stationRenameButton.TabIndex = 5; - this.stationRenameButton.Text = "Rename Station"; - this.stationRenameButton.UseSelectable = true; - // // stationAddButton // this.stationAddButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -1050,10 +1020,11 @@ private void InitializeComponent() this.stationAddButton.FontWeight = MetroFramework.MetroButtonWeight.Regular; this.stationAddButton.Location = new System.Drawing.Point(11, 30); this.stationAddButton.Name = "stationAddButton"; - this.stationAddButton.Size = new System.Drawing.Size(187, 177); + this.stationAddButton.Size = new System.Drawing.Size(280, 177); this.stationAddButton.TabIndex = 4; this.stationAddButton.Text = "Add Station"; this.stationAddButton.UseSelectable = true; + this.stationAddButton.Click += new System.EventHandler(this.stationAddButton_Click); // // metroLabel3 // @@ -1067,10 +1038,97 @@ private void InitializeComponent() this.metroLabel3.Text = "Select Stations"; this.metroLabel3.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // + // itemNameTextBox + // + this.itemNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + // + // + // + this.itemNameTextBox.CustomButton.Image = null; + this.itemNameTextBox.CustomButton.Location = new System.Drawing.Point(384, 2); + this.itemNameTextBox.CustomButton.Name = ""; + this.itemNameTextBox.CustomButton.Size = new System.Drawing.Size(31, 31); + this.itemNameTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.itemNameTextBox.CustomButton.TabIndex = 1; + this.itemNameTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.itemNameTextBox.CustomButton.UseSelectable = true; + this.itemNameTextBox.CustomButton.Visible = false; + this.itemNameTextBox.FontSize = MetroFramework.MetroTextBoxSize.Medium; + this.itemNameTextBox.Lines = new string[] { + "metroTextBox1"}; + this.itemNameTextBox.Location = new System.Drawing.Point(166, 45); + this.itemNameTextBox.MaxLength = 32767; + this.itemNameTextBox.Multiline = true; + this.itemNameTextBox.Name = "itemNameTextBox"; + this.itemNameTextBox.PasswordChar = '\0'; + this.itemNameTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.itemNameTextBox.SelectedText = ""; + this.itemNameTextBox.SelectionLength = 0; + this.itemNameTextBox.SelectionStart = 0; + this.itemNameTextBox.ShortcutsEnabled = true; + this.itemNameTextBox.Size = new System.Drawing.Size(418, 36); + this.itemNameTextBox.TabIndex = 17; + this.itemNameTextBox.Text = "metroTextBox1"; + this.itemNameTextBox.UseSelectable = true; + this.itemNameTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.itemNameTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // label9 + // + this.label9.Location = new System.Drawing.Point(6, 45); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(154, 36); + this.label9.TabIndex = 16; + this.label9.Text = "Name:"; + // + // menuTitleTextBox + // + this.menuTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + // + // + // + this.menuTitleTextBox.CustomButton.Image = null; + this.menuTitleTextBox.CustomButton.Location = new System.Drawing.Point(384, 2); + this.menuTitleTextBox.CustomButton.Name = ""; + this.menuTitleTextBox.CustomButton.Size = new System.Drawing.Size(31, 31); + this.menuTitleTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.menuTitleTextBox.CustomButton.TabIndex = 1; + this.menuTitleTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.menuTitleTextBox.CustomButton.UseSelectable = true; + this.menuTitleTextBox.CustomButton.Visible = false; + this.menuTitleTextBox.FontSize = MetroFramework.MetroTextBoxSize.Medium; + this.menuTitleTextBox.Lines = new string[] { + "metroTextBox1"}; + this.menuTitleTextBox.Location = new System.Drawing.Point(166, 57); + this.menuTitleTextBox.MaxLength = 32767; + this.menuTitleTextBox.Multiline = true; + this.menuTitleTextBox.Name = "menuTitleTextBox"; + this.menuTitleTextBox.PasswordChar = '\0'; + this.menuTitleTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.menuTitleTextBox.SelectedText = ""; + this.menuTitleTextBox.SelectionLength = 0; + this.menuTitleTextBox.SelectionStart = 0; + this.menuTitleTextBox.ShortcutsEnabled = true; + this.menuTitleTextBox.Size = new System.Drawing.Size(418, 36); + this.menuTitleTextBox.TabIndex = 17; + this.menuTitleTextBox.Text = "metroTextBox1"; + this.menuTitleTextBox.UseSelectable = true; + this.menuTitleTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.menuTitleTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // label12 + // + this.label12.Location = new System.Drawing.Point(6, 57); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(154, 36); + this.label12.TabIndex = 16; + this.label12.Text = "Menu Title:"; + // // AdminStationView // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; this.ClientSize = new System.Drawing.Size(1414, 918); this.Controls.Add(this.adminTabControl); this.Name = "AdminStationView"; @@ -1102,11 +1160,10 @@ private void InitializeComponent() private MetroFramework.Controls.MetroTabPage employeeTab; private MetroFramework.Controls.MetroLabel metroLabel1; private System.Windows.Forms.GroupBox menuGroup1; - private MetroFramework.Controls.MetroButton metroButton2; private MetroFramework.Controls.MetroButton metroButton1; private MetroFramework.Controls.MetroButton metroButton3; private System.Windows.Forms.GroupBox menuOptions; - private System.Windows.Forms.ListBox displayedOnDevices; + private System.Windows.Forms.ListBox menuDisplayedOnListBox; private System.Windows.Forms.Label label1; private MetroFramework.Controls.MetroTabPage stationTab; private System.Windows.Forms.ListBox menuItemListBox; @@ -1115,7 +1172,6 @@ private void InitializeComponent() 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 itemPrintingListBox; @@ -1136,7 +1192,6 @@ private void InitializeComponent() private System.Windows.Forms.ListBox stationTypeListBox; private System.Windows.Forms.GroupBox groupBox5; private MetroFramework.Controls.MetroButton stationRemoveButton; - private MetroFramework.Controls.MetroButton stationRenameButton; private MetroFramework.Controls.MetroButton stationAddButton; private MetroFramework.Controls.MetroLabel metroLabel3; private MetroFramework.Controls.MetroButton metroButton4; @@ -1157,5 +1212,9 @@ private void InitializeComponent() private System.Windows.Forms.Label pin; private System.Windows.Forms.ListBox menuListBox; private System.Windows.Forms.ComboBox menuSelectionBox; + private MetroFramework.Controls.MetroTextBox itemNameTextBox; + private System.Windows.Forms.Label label9; + private MetroFramework.Controls.MetroTextBox menuTitleTextBox; + private System.Windows.Forms.Label label12; } } \ No newline at end of file diff --git a/Enigma/StationsGUI/AdminStationView.cs b/Enigma/StationsGUI/AdminStationView.cs index 4cfe8c5..07afcff 100644 --- a/Enigma/StationsGUI/AdminStationView.cs +++ b/Enigma/StationsGUI/AdminStationView.cs @@ -1,4 +1,5 @@ -using EnigmaX; +using Enigma.Popups; +using EnigmaX; using EnigmaX.Classes; using MetroFramework.Forms; using MySql.Data.MySqlClient; @@ -31,7 +32,7 @@ public AdminStationView(Employee loggedIn) private void AdminStationView_Load(object sender, EventArgs e) { loadAllData(); - // drawAllData(); + drawAllData(); } private void loadAllData() { @@ -52,6 +53,8 @@ private void drawAllData() private void drawMenus() { menuSelectionBox.Items.Clear(); menuListBox.Items.Clear(); + menuDisplayedOnListBox.ClearSelected(); + menuTitleTextBox.ResetText(); foreach (EnigmaMenu menu in enigmaMenus) { menuSelectionBox.Items.Add(menu); @@ -62,6 +65,9 @@ private void drawMenus() { { menuListBox.Items.Add(item); } + foreach (Station station in enigmaStations) { + menuDisplayedOnListBox.Items.Add(station); + } } private void drawMenuItems() @@ -92,6 +98,7 @@ private void drawEmployees() } private void loadMenus() { + enigmaMenus.Clear(); DBConnect db = new DBConnect(); List> menus = db.ReadCommand("SELECT * FROM Menus", "id", "title", "items"); foreach (Dictionary menu in menus) { @@ -102,6 +109,7 @@ private void loadMenus() { private void loadMenuItems() { + enigmaMenuItems.Clear(); DBConnect db = new DBConnect(); List> result = db.ReadCommand("SELECT * FROM MenuItems", "id", "title", "description", "price", "category", "printingStation"); foreach (Dictionary row in result) @@ -113,6 +121,7 @@ private void loadMenuItems() private void loadEmployees() { + enigmaEmployees.Clear(); DBConnect db = new DBConnect(); List> employees = db.ReadCommand("SELECT * FROM Users", "id", "first", "last", "role", "pin"); foreach (Dictionary row in employees) @@ -124,6 +133,7 @@ private void loadEmployees() private void loadStations() { + enigmaStations.Clear(); DBConnect db = new DBConnect(); List> result = db.ReadCommand("SELECT * FROM Stations", "stationid", "type"); foreach (Dictionary row in result) @@ -162,7 +172,10 @@ private void menuSelectionBox_SelectedIndexChanged(object sender, EventArgs e) private void openMenu(int id) { EnigmaMenu menu = enigmaMenus[id]; menuListBox.ClearSelected(); + menuDisplayedOnListBox.ClearSelected(); + menuTitleTextBox.ResetText(); + menuTitleTextBox.Text = menu.Title; foreach (EnigmaMenuItem item in menu.Items) { Predicate itemFinder = (EnigmaMenuItem p) => { return p.Id == item.Id; }; menuListBox.SetSelected(enigmaMenuItems.FindIndex(itemFinder), true); @@ -175,11 +188,13 @@ private void openItem(int id) { itemDescriptionTextbox.ResetText(); itemPrice.ResetText(); itemPrintingListBox.ClearSelected(); + itemNameTextBox.ResetText(); itemPrice.Value = decimal.Parse(item.Price.ToString()); itemDescriptionTextbox.Text = item.Description; - itemCategoryListBox.SetSelected(getItemCategoryId(item.ItemType), true); - itemPrintingListBox.SetSelected(getPrintingStationId(item.PrintingType), true); + itemCategoryListBox.SetSelected((int)item.ItemType, true); + itemPrintingListBox.SetSelected((int)item.PrintingType, true); + itemNameTextBox.Text = item.Title; } private void openEmployee(int id) { @@ -194,84 +209,132 @@ private void openEmployee(int id) { employeePinNumber.Value = employee.Pin; foreach (EmployeeRole role in employee.Roles) { - + int index = (int)role; + employeeRoleListBox.SetSelected(index, true); } } - 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 void openStation(int id) { + Station station = enigmaStations[id]; + stationTypeListBox.ClearSelected(); + stationTypeListBox.SetSelected((int)station.StationType, true); + } - 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 void menuTab_Click(object sender, EventArgs e) + { + } - private int getPrintingStationId(PrintingStationType type) + private void menuItemListBox_SelectedIndexChanged(object sender, EventArgs e) { - switch (type) - { - case PrintingStationType.cold: - return 0; - case PrintingStationType.hot: - return 1; - default: - return 0; - } + openItem(menuItemListBox.SelectedIndex); } - private PrintingStationType getPrintingStationEnum(int id) + private void employeeListBox_SelectedIndexChanged(object sender, EventArgs e) { - switch (id) - { - case 0: - return PrintingStationType.cold; - case 1: - return PrintingStationType.hot; - default: - return PrintingStationType.cold; - } + openEmployee(employeeListBox.SelectedIndex); } - private void menuTab_Click(object sender, EventArgs e) + private void stationListBox_SelectedIndexChanged(object sender, EventArgs e) { + openStation(stationListBox.SelectedIndex); + } + private void menuSaveButton_Click(object sender, EventArgs e) + { + EnigmaMenu menu = enigmaMenus[menuSelectionBox.SelectedIndex]; + menu.Title = menuTitleTextBox.Text; + menu.Items = menuItemListBox.SelectedItems.Cast().ToList(); + drawMenus(); } - private void menuItemListBox_SelectedIndexChanged(object sender, EventArgs e) + private void itemsSaveButton_Click(object sender, EventArgs e) { - openItem(menuItemListBox.SelectedIndex); + EnigmaMenuItem item = enigmaMenuItems[menuItemListBox.SelectedIndex]; + item.Description = itemDescriptionTextbox.Text; + item.ItemType = (MenuItemType)itemCategoryListBox.SelectedIndex; + item.PrintingType = (PrintingStationType)itemPrintingListBox.SelectedIndex; + item.Title = itemNameTextBox.Text; + item.Price = float.Parse(itemPrice.Value.ToString()); + drawMenuItems(); } - private void employeeListBox_SelectedIndexChanged(object sender, EventArgs e) + private void metroButton4_Click(object sender, EventArgs e) { - openEmployee(employeeListBox.SelectedIndex); + Employee employee = enigmaEmployees[employeeListBox.SelectedIndex]; + employee.FirstName = employeeFirstNameTextBox.Text; + employee.LastName = employeeLastNameTextBox.Text; + employee.Pin = Convert.ToInt32(employeePinNumber.Value); + employee.Roles = employeeRoleListBox.SelectedItems.Cast().ToList(); + drawEmployees(); + } + + private void stationSaveButton_Click(object sender, EventArgs e) + { + Station station = enigmaStations[stationListBox.SelectedIndex]; + station.StationType = (StationTypeDef)stationTypeListBox.SelectedIndex; + drawStations(); + } + + private void metroButton1_Click(object sender, EventArgs e) + { + AddPopup addPopup = new AddPopup("Menu", "Menu Title:"); + if (addPopup.ShowDialog() == DialogResult.OK) { + DBConnect db = new DBConnect(); + MySqlCommand cmd = new MySqlCommand("INSERT INTO Menus (title) VALUES (@Title)"); + cmd.Parameters.AddWithValue("@Title", addPopup.returnValue); + db.WriteCommand(cmd); + loadMenus(); + drawMenus(); + menuSelectionBox.SelectedIndex = menuSelectionBox.Items.Count - 1; + } + } + + private void addItemButton_Click(object sender, EventArgs e) + { + AddPopup addPopup = new AddPopup("Item", "Item Title:"); + if (addPopup.ShowDialog() == DialogResult.OK) + { + DBConnect db = new DBConnect(); + MySqlCommand cmd = new MySqlCommand("INSERT INTO MenuItems (title) VALUES (@Title)"); + cmd.Parameters.AddWithValue("@Title", addPopup.returnValue); + db.WriteCommand(cmd); + loadMenuItems(); + drawMenuItems(); + menuItemListBox.SetSelected(menuItemListBox.Items.Count - 1, true); + } + } + + private void employeeAddButton_Click(object sender, EventArgs e) + { + AddPopup addPopup = new AddPopup("Employee", "Employee Pin:"); + if (addPopup.ShowDialog() == DialogResult.OK) + { + DBConnect db = new DBConnect(); + MySqlCommand cmd = new MySqlCommand("INSERT INTO Users (pin) VALUES (@Pin)"); + cmd.Parameters.AddWithValue("@Pin", addPopup.returnValue); + db.WriteCommand(cmd); + loadEmployees(); + drawEmployees(); + employeeListBox.SetSelected(employeeListBox.Items.Count - 1, true); + } + } + + private void stationAddButton_Click(object sender, EventArgs e) + { + AddPopup addPopup = new AddPopup("Station", "Station ID:"); + if (addPopup.ShowDialog() == DialogResult.OK) + { + DBConnect db = new DBConnect(); + MySqlCommand cmd = new MySqlCommand("INSERT INTO Stations (stationid) VALUES (@Id)"); + cmd.Parameters.AddWithValue("@Id", addPopup.returnValue); + db.WriteCommand(cmd); + loadStations(); + drawStations(); + stationListBox.SetSelected(stationListBox.Items.Count - 1, true); + } } } } diff --git a/EnigmaX/Classes/Employee.cs b/EnigmaX/Classes/Employee.cs index b4531cb..8f6f002 100644 --- a/EnigmaX/Classes/Employee.cs +++ b/EnigmaX/Classes/Employee.cs @@ -89,8 +89,12 @@ public static Employee getEmployeeWithPin(string pin) public static List getRoles(string roles) { List roleslist = new List(); - foreach (string role in roles.Split(',')) { - roleslist.Add((EmployeeRole)Enum.Parse(typeof(EmployeeRole), role)); + if (roles != string.Empty) + { + foreach (string role in roles.Split(',')) + { + roleslist.Add((EmployeeRole)Enum.Parse(typeof(EmployeeRole), role)); + } } return roleslist; } diff --git a/EnigmaX/Classes/EnigmaMenu.cs b/EnigmaX/Classes/EnigmaMenu.cs index b4fb8e3..4018994 100644 --- a/EnigmaX/Classes/EnigmaMenu.cs +++ b/EnigmaX/Classes/EnigmaMenu.cs @@ -49,8 +49,12 @@ public List Items public static List stringToItemList(string items) { List itemList = new List(); - foreach (string item in items.Split('|')) { - itemList.Add(EnigmaMenuItem.idToMenuItem(Convert.ToInt32(item))); + if (items != string.Empty) + { + foreach (string item in items.Split('|')) + { + itemList.Add(EnigmaMenuItem.idToMenuItem(Convert.ToInt32(item))); + } } return itemList; } diff --git a/EnigmaX/Classes/Station.cs b/EnigmaX/Classes/Station.cs index 13070ba..36f8940 100644 --- a/EnigmaX/Classes/Station.cs +++ b/EnigmaX/Classes/Station.cs @@ -35,6 +35,9 @@ public StationTypeDef StationType { return _stationType; } + set { + _stationType = value; + } } public Station(StationTypeDef type, string stationid) {