diff --git a/Scripts/.vs/ProjectSettings.json b/Scripts/.vs/ProjectSettings.json new file mode 100644 index 00000000..f8b48885 --- /dev/null +++ b/Scripts/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/Scripts/.vs/Scripts/FileContentIndex/ddaf6bfc-05db-475a-a568-8558e2315e13.vsidx b/Scripts/.vs/Scripts/FileContentIndex/ddaf6bfc-05db-475a-a568-8558e2315e13.vsidx new file mode 100644 index 00000000..ef310061 Binary files /dev/null and b/Scripts/.vs/Scripts/FileContentIndex/ddaf6bfc-05db-475a-a568-8558e2315e13.vsidx differ diff --git a/Scripts/.vs/Scripts/FileContentIndex/read.lock b/Scripts/.vs/Scripts/FileContentIndex/read.lock new file mode 100644 index 00000000..e69de29b diff --git a/Scripts/.vs/Scripts/v17/.wsuo b/Scripts/.vs/Scripts/v17/.wsuo new file mode 100644 index 00000000..f65f65f4 Binary files /dev/null and b/Scripts/.vs/Scripts/v17/.wsuo differ diff --git a/Scripts/.vs/VSWorkspaceState.json b/Scripts/.vs/VSWorkspaceState.json new file mode 100644 index 00000000..d98e0578 --- /dev/null +++ b/Scripts/.vs/VSWorkspaceState.json @@ -0,0 +1,12 @@ +{ + "ExpandedNodes": [ + "", + "\\Admin", + "\\Data Classes", + "\\Databases", + "\\Networking", + "\\Till Functions" + ], + "SelectedNode": "\\Till Functions\\StockLookup.cs", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/Scripts/.vs/slnx.sqlite b/Scripts/.vs/slnx.sqlite new file mode 100644 index 00000000..acf725bc Binary files /dev/null and b/Scripts/.vs/slnx.sqlite differ diff --git a/Scripts/Admin/StaffAdd.cs b/Scripts/Admin/StaffAdd.cs index 77472228..759634c4 100644 --- a/Scripts/Admin/StaffAdd.cs +++ b/Scripts/Admin/StaffAdd.cs @@ -22,13 +22,15 @@ public void ConfirmInputs() DateTime dobDT; DateTime startDT; DateTime endDT; + // Validate that none of the data fields are left blank if(idInput.text == "" || firstNameInput.text == "" || lastNameInput.text == "" || dateOfBirthInput.text == "" || startDateInput.text == "" || endDateInput.text == "" || permissionsLevelInput.text == "") { return; - }else if(!DateTime.TryParse(dateOfBirthInput.text, out dobDT) || !DateTime.TryParse(startDateInput.text, out startDT) || !DateTime.TryParse(endDateInput.text, out endDT)) + }else if(!DateTime.TryParse(dateOfBirthInput.text, out dobDT) || !DateTime.TryParse(startDateInput.text, out startDT) || !DateTime.TryParse(endDateInput.text, out endDT)) // Validate that a correct date has been entered { return; } + // Format a server query with the data and add the the send queue string q_toSend = "&STAFFWR|" + idInput.text + "|" + firstNameInput.text + "|" + lastNameInput.text + "|" + dobDT.ToString("s") + "|" + startDT.ToString("s") + "|" + endDT.ToString("s") + "|" + permissionsLevelInput.text; FindObjectOfType().instance.toSend.AddLast(q_toSend); CloseWindow(); diff --git a/Scripts/Admin/StockItemAdd.cs b/Scripts/Admin/StockItemAdd.cs index d8be4416..91d9f804 100644 --- a/Scripts/Admin/StockItemAdd.cs +++ b/Scripts/Admin/StockItemAdd.cs @@ -14,14 +14,18 @@ public class StockItemAdd : MonoBehaviour //Activated when the confirm button is pressed public void OnConfirmButtonPress() { + // Validate that none of the inputs are left blank if(idInput.text == "" || nameInput.text == "" || priceInput.text == "" || typeInput.text == "") { Debug.LogWarning("Missing data, cannot send request"); return; } + // Format a query for the server and add it to the send queue string q_toSend = "&STOCKWR|" + idInput.text + "|" + nameInput.text + "|" + priceInput.text + "|" + typeInput.text; FindObjectOfType().toSend.AddLast(q_toSend); + + //Reset the input fields idInput.text = ""; nameInput.text = ""; priceInput.text = ""; diff --git a/Scripts/Admin/StockModifyController.cs b/Scripts/Admin/StockModifyController.cs index d4b4118b..85641b6c 100644 --- a/Scripts/Admin/StockModifyController.cs +++ b/Scripts/Admin/StockModifyController.cs @@ -26,12 +26,6 @@ void Start() client = FindObjectOfType(); } - // Update is called once per frame - void Update() - { - - } - //Run when a UI button is pressed public void ConfirmButtonPress() { diff --git a/Scripts/Databases/DatabaseManager.cs b/Scripts/Databases/DatabaseManager.cs index 6b4b1e75..aa85ff3a 100644 --- a/Scripts/Databases/DatabaseManager.cs +++ b/Scripts/Databases/DatabaseManager.cs @@ -40,8 +40,7 @@ IDbConnection OpenConenctionToDB() { //formats the database's location string connection = "URI=file:" + Application.persistentDataPath + "/Babyy_Database.db"; - //Debug.Log("Database Location : " + Application.persistentDataPath + "/Babyy_Database.db"); //For displaying the current path of the database file - + //Opens the databse conneciton IDbConnection dbConnection = new SqliteConnection(connection); dbConnection.Open(); @@ -67,6 +66,7 @@ void CreateStockTable() //create a command IDbCommand dbCommand; dbCommand = dbcon.CreateCommand(); + //create the SQL command and execute it string q_createTable = "CREATE TABLE IF NOT EXISTS stock_table (id INTEGER PRIMARY KEY, name VARCHAR(255), price FLOAT, type INTEGER);"; dbCommand.CommandText = q_createTable; @@ -79,9 +79,11 @@ public List ReadValuesInStockTable(long id, string itemName) //creates a temp list to store values and a temp string List items = new(); string tempIdString; + //create a command and reader IDbCommand cmnd_read = dbcon.CreateCommand(); IDataReader reader; + //check to see if id is its defult value/formats the id as a string if (id == 0) { @@ -91,10 +93,12 @@ public List ReadValuesInStockTable(long id, string itemName) { tempIdString = id.ToString(); } + //create the SQL command and execute it string q_readTable = "SELECT * FROM stock_table WHERE id LIKE '" + tempIdString + "' AND name LIKE '%" + itemName + "%' ORDER BY id ASC"; cmnd_read.CommandText = q_readTable; reader = cmnd_read.ExecuteReader(); + //while the reader is recieveing data from the database while (reader.Read()) { @@ -105,6 +109,7 @@ public List ReadValuesInStockTable(long id, string itemName) int typeRead = Convert.ToInt32(reader[3]); items.Add(new Item(idRead, nameRead, priceRead, typeRead)); } + //return all the items return items; } @@ -119,6 +124,7 @@ public List ReadValuesInStockTable(long id, string itemName) //Inserts values Into the stock table public void InsertValueIntoStockTable(long id, string itemName, float price, int type) { + //Create a command and execute it IDbCommand cmnd_insert = dbcon.CreateCommand(); string q_insertTable = "INSERT OR REPLACE Into stock_table (id, name, price, type) VALUES (" + id + ", '" + itemName + "', " + price + ", " + type + ");"; cmnd_insert.CommandText = q_insertTable; @@ -130,6 +136,8 @@ public void InsertValueIntoStockTable(long id, string itemName, float price, int public void DeleteValueInStockTable(long id) { Item item = ReadValuesInStockTable(id, "")[0]; + + //Create a command and execute it IDbCommand cmnd_delete = dbcon.CreateCommand(); DeleteValueInCatStockTable(id); string q_deleteItem = "DELETE FROM stock_table WHERE id = " + id + ";"; @@ -142,6 +150,8 @@ public void DeleteValueInStockTable(long id) public void DeleteValueInCatStockTable(long id) { Item item = ReadValuesInStockTable(id, "")[0]; + + //Create a command and execute it IDbCommand cmnd_delete = dbcon.CreateCommand(); string q_deleteItem = "DELETE FROM categoryItem_table WHERE itemID = " + id + ";"; cmnd_delete.CommandText = q_deleteItem; @@ -149,8 +159,9 @@ public void DeleteValueInCatStockTable(long id) } //create the catagory table - void CreateCategoryTable() + void CreateCategoryTable() { + //Create a command and execute it IDbCommand dbCommand; dbCommand = dbcon.CreateCommand(); string q_createTable = "CREATE TABLE IF NOT EXISTS category_table (id INTEGER PRIMARY KEY, name VARCHAR(255), color VARCHAR(255));"; @@ -162,11 +173,15 @@ void CreateCategoryTable() public List ReadValuesInCategoryTable(int id) { List categories = new(); + + //Create a command and execute it IDbCommand cmnd_read = dbcon.CreateCommand(); IDataReader reader; string q_readTable = "SELECT * FROM category_table WHERE id LIKE '%" + id + "' ORDER BY id ASC;"; cmnd_read.CommandText = q_readTable; reader = cmnd_read.ExecuteReader(); + + //While the reader is recieving data from the database while (reader.Read()) { int catIDRead = Convert.ToInt32(reader[0]); @@ -180,6 +195,7 @@ public List ReadValuesInCategoryTable(int id) //Inserts values Into the category table public void InsertValuesIntoCategoryTable(int id, string categoryName, UnityEngine.Color categoryColour) { + //Create a command and execute it IDbCommand cmnd_insert = dbcon.CreateCommand(); string q_insertTable = "INSERT OR REPLACE Into category_table (id, name, colour) VALUES (" + id + ", '" + categoryName + "', '" + ColorUtility.ToHtmlStringRGB(categoryColour).ToString() + "');"; cmnd_insert.CommandText = q_insertTable; @@ -189,6 +205,7 @@ public void InsertValuesIntoCategoryTable(int id, string categoryName, UnityEngi //Creates the cateogry item Table void CreateCategoryItemTable() { + //Create a command and execute it IDbCommand dbCommand = dbcon.CreateCommand(); string q_createTable = "CREATE TABLE IF NOT EXISTS categoryItem_table (categoryID INTEGER, itemID INTEGER, itemPos INTEGER, PRIMARY KEY(categoryID, itemID) CONSTRAINT itemID FOREIGN KEY (itemID) REFERENCES stock_table (id)) ON DELETE CASCADE;"; dbCommand.CommandText = q_createTable; @@ -199,11 +216,15 @@ void CreateCategoryItemTable() public List> ReadValuesInCategoryItemTable(int categoryID) { List> items = new(); + + //Create a command and execute it IDbCommand cmnd_read = dbcon.CreateCommand(); IDataReader reader; string q_readTable = "SELECT itemID, itemPos FROM categoryItem_table WHERE categoryID LIKE '" + categoryID + "';"; cmnd_read.CommandText = q_readTable; reader = cmnd_read.ExecuteReader(); + + //While the reader is recieving data from the database while (reader.Read()) { long itemIdRead = Convert.ToInt64(reader[0]); @@ -216,6 +237,7 @@ public List> ReadValuesInCategoryItemTable(int categoryI //Inserts values Into the category item table public void InsertValuesIntoCategoryItemsTable(int categoryID, long itemID, int itemPos) { + //Create a command and execute it IDbCommand cmnd_insert = dbcon.CreateCommand(); string q_insertTable = "INSERT OR REPLACE Into categoryItem_table (categoryId, itemID, itemPos) VALUES (" + categoryID + ", " + itemID + ", " + itemPos + ");"; cmnd_insert.CommandText = q_insertTable; @@ -225,6 +247,7 @@ public void InsertValuesIntoCategoryItemsTable(int categoryID, long itemID, int //creates the staff table void CreateStaffTable() { + //Create a command and execute it IDbCommand dbCommand = dbcon.CreateCommand(); string q_createTable = "CREATE TABLE IF NOT EXISTS staff_table (staffID INTEGER PRIMARY KEY, lastName VARCHAR(255), firstName VARCHAR(255), dateOfBirth VARCHAR(255), startDate VARCHAR(255), endDate VARCHAR(255), permissionsLv INTEGER);"; dbCommand.CommandText = q_createTable; @@ -235,11 +258,15 @@ void CreateStaffTable() public List ReadStaffMembersInTable(int staffID, string staffLastName, string staffFirstName) { List data = new(); + + //Create a command and execute it IDbCommand cmnd_read = dbcon.CreateCommand(); IDataReader reader; string q_readTable = "SELECT * FROM staff_table WHERE staffID = " + staffID.ToString() + " AND lastName LIKE '%" + staffLastName + "%' AND firstName LIKE '%" + staffFirstName + "%';"; cmnd_read.CommandText = q_readTable; reader = cmnd_read.ExecuteReader(); + + //While the reader is recieving data from the database while (reader.Read()) { int staffIDRead = Convert.ToInt32(reader[0]); @@ -257,6 +284,7 @@ public List ReadStaffMembersInTable(int staffID, string staffLastNa //Inserts values Into the staff table public void InsertValuesIntoStaffTable(StaffMember staffMemberToAdd) { + //Create a command and execute it IDbCommand cmnd_insert = dbcon.CreateCommand(); string q_insertTable = "INSERT OR REPLACE Into staff_table (staffID, lastName, firstName, dateOfBirth, startDate, endDate, permissionsLv) VALUES (" + staffMemberToAdd.staffID.ToString() + ", '" + staffMemberToAdd.lastName + "', '" + staffMemberToAdd.firstName + "', '" + staffMemberToAdd.dateOfBirth.ToString("s") + "', '" + staffMemberToAdd.startDate.ToString("s") + "', '" + staffMemberToAdd.endDate.ToString("s") + "', " + staffMemberToAdd.permissionLevel.ToString() + ");"; cmnd_insert.CommandText = q_insertTable; @@ -266,6 +294,7 @@ public void InsertValuesIntoStaffTable(StaffMember staffMemberToAdd) //Creates the transaction table void CreateTransactionTable() { + //Create a command and execute it IDbCommand dbCommand = dbcon.CreateCommand(); string q_createTable = "CREATE TABLE IF NOT EXISTS transaction_table (transactionID INTEGER PRIMARY KEY, transactionDateTime VARCHAR(255), transactionTotal FLOAT, paymentType INTEGER, staffID INTEGER);"; dbCommand.CommandText = q_createTable; @@ -276,11 +305,15 @@ void CreateTransactionTable() public List ReadValuesFromTransactionTable(long transID, DateTime transDateTime, int staffIDToFind, float transTotal) { List data = new(); + + //Create a command and execute it IDbCommand cmnd_read = dbcon.CreateCommand(); IDataReader reader; string q_readTable = "SELECT * FROM transaction_table WHERE transID Like '%" + transID.ToString() + "%' AND transactionDateTime LIKE '%" + transDateTime.ToString("s") + "%' OR transactionTotal = " + transTotal + " AND staffID LIKE '%" + staffIDToFind.ToString() + "%';"; cmnd_read.CommandText = q_readTable; reader = cmnd_read.ExecuteReader(); + + //While the reader is recieving data from the database while (reader.Read()) { long transIDRead = Convert.ToInt64(reader[0]); @@ -296,6 +329,7 @@ public List ReadValuesFromTransactionTable(long transID, DateTime t //Inserts values Into the transaction table public void InsertValuesIntoTransTable(long transID, DateTime transDateTime, float transTotal, int payType, int staffID) { + //Create a command and execute it IDbCommand cmnd_insert = dbcon.CreateCommand(); string q_insertTable = "INSERT OR REPLACE Into transaction_table (transactionID, transactionDateTime, transactionTotal, paymentType, staffID) VALUES (" + transID.ToString() + ", '" + transDateTime.ToString("s") + "', '" + transTotal.ToString() + "', " + payType.ToString() + ", " + staffID + ");"; cmnd_insert.CommandText = q_insertTable; @@ -305,6 +339,7 @@ public void InsertValuesIntoTransTable(long transID, DateTime transDateTime, flo //creeates the transaction item table void CreateTransactionItemTable() { + //Create a command and execute it IDbCommand dbCommand = dbcon.CreateCommand(); string q_createTable = "CREATE TABLE IF NOT EXISTS transactionItem_table (transactionID INTEGER, itemID INTEGER, quantity INTEGER, price FLOAT, PRIMARY KEY(transactionID, itemID) CONSTRAINT itemID FOREIGN KEY (itemID) REFERENCES legacy_stock_table (id));"; dbCommand.CommandText = q_createTable; @@ -315,11 +350,15 @@ void CreateTransactionItemTable() public List<(Item, int)> ReadValuesFromTransactionItemTable(long transID) { List<(Item, int)> data = new(); + + //Create a command and execute it IDbCommand cmnd_read = dbcon.CreateCommand(); IDataReader reader; string q_readTable = "SELECT * FROM transactionItem_table WHERE transID LIKE '%" + transID.ToString() + "%';"; cmnd_read.CommandText = q_readTable; reader = cmnd_read.ExecuteReader(); + + //While the reader is recieveing data from the database while (reader.Read()) { Item item = new(Convert.ToInt32(reader[1]), "", Convert.ToInt32(reader[3]), 0); @@ -332,6 +371,7 @@ void CreateTransactionItemTable() //Inserts values Into the transaction item table public void InsertValuesIntoTransItemTable(long transID, long itemID, int quantity, float price) { + //Create a command and execute it IDbCommand cmnd_insert = dbcon.CreateCommand(); string q_insertTable = "INSERT OR REPLACE Into transactionItem_table (transactionID, itemID, quantity, price) VALUES (" + transID.ToString() + ", " + itemID.ToString() + ", " + quantity.ToString() + ", " + price.ToString() + ");"; cmnd_insert.CommandText = q_insertTable; @@ -341,9 +381,10 @@ public void InsertValuesIntoTransItemTable(long transID, long itemID, int quanti //Create a legacy table for stock items void CreateLegacyStockTable() { - //create a command + //Create a command and execute it IDbCommand dbCommand; dbCommand = dbcon.CreateCommand(); + //create the SQL command and execute it string q_createTable = "CREATE TABLE IF NOT EXISTS legacy_stock_table (id INTEGER PRIMARY KEY, name VARCHAR(255), price FLOAT, type INTEGER);"; dbCommand.CommandText = q_createTable; @@ -353,13 +394,14 @@ void CreateLegacyStockTable() //Reads values in the legacy stock table public List ReadValuesInLegacyStockTable(long id, string itemName) { - //Debug.Log("Requesting Read Values From Stock Table"); //creates a temp list to store values and a temp string List items = new(); string tempIdString; + //create a command and reader IDbCommand cmnd_read = dbcon.CreateCommand(); IDataReader reader; + //check to see if id == 0 if (id == 0) { @@ -369,11 +411,12 @@ public List ReadValuesInLegacyStockTable(long id, string itemName) { tempIdString = id.ToString(); } + //create the SQL command and execute it string q_readTable = "SELECT * FROM legacy_stock_table WHERE id = '" + tempIdString + "' AND name LIKE '%" + itemName + "%' ORDER BY id ASC"; cmnd_read.CommandText = q_readTable; reader = cmnd_read.ExecuteReader(); - //Debug.Log(q_readTable); + //while the reader is recieveing data from the database while (reader.Read()) { @@ -384,6 +427,7 @@ public List ReadValuesInLegacyStockTable(long id, string itemName) int typeRead = Convert.ToInt32(reader[3]); items.Add(new Item(idRead, nameRead, priceRead, typeRead)); } + //return all the items return items; } @@ -392,6 +436,7 @@ public List ReadValuesInLegacyStockTable(long id, string itemName) //Inserts values Into the legacy stock table public void InsertValueIntoLegacyStockTable(long id, string itemName, float price, int type) { + //Create a command and execute it IDbCommand cmnd_insert = dbcon.CreateCommand(); string q_insertTable = "INSERT OR REPLACE INTO legacy_stock_table (id, name, price, type) VALUES (" + id + ", '" + itemName + "', " + price + ", " + type + ");"; cmnd_insert.CommandText = q_insertTable; diff --git a/Scripts/Databases/ServerController.cs b/Scripts/Databases/ServerController.cs index c95a3c8a..4be5cd16 100644 --- a/Scripts/Databases/ServerController.cs +++ b/Scripts/Databases/ServerController.cs @@ -23,67 +23,88 @@ void Start() //Processes a stock lookup request public void StockLookupRequest(ServerClient client, long id, string itemName) { - //reads stock items from the database + //Reads stock items from the database List data = dbManager.instance.ReadValuesInStockTable(id, itemName); - //Debug.Log("Length of data: " + data.Count); - //cycle through each item + + //Cycle through each item foreach (Item item in data) { - //send each item to the client that requested the lookup + //Send each item to the client that requested the lookup string toSend = "%STOCKLURT|" + item.id.ToString() + "|" + item.name + "|" + item.price.ToString() + "|" + item.type.ToString(); server.instance.ToSend.AddLast((toSend, client)); } - //send the closing statement for the request + + //Send the closing statement for the request server.instance.ToSend.AddLast(("%STOCKLURT|~END", client)); } //Processes a category request public void CategoryRequest(ServerClient client, int id) { + //Reads the categories from the database List data = dbManager.instance.ReadValuesInCategoryTable(id); + + //cycle through each piece of data foreach(Category cat in data) { + //Send each piece of data to the client that requested the lookup string catColour = UnityEngine.ColorUtility.ToHtmlStringRGBA(cat.categoryColour); string toSend = "%CATEGORYRT|" + cat.categoryID + "|" + cat.categoryName + "|" + catColour; server.instance.ToSend.AddLast((toSend, client)); } + + //Send the closing statement for the request server.instance.ToSend.AddLast(("%CATEGORYRT|~END", client)); } //Processes a category item request public void CategoryItemRequest(ServerClient client, int id) { + //Reads the category items from the database List> data = dbManager.instance.ReadValuesInCategoryItemTable(id); //ID, Pos + + //Cycle through each piece of data foreach(KeyValuePair kvp in data) { + //Send each piece of data to the client that requested the lookup string toSend = "%CATEGORYITEMRT|" + kvp.Key.ToString() + "|" + kvp.Value.ToString(); server.instance.ToSend.AddLast((toSend, client)); } + + //Send the closing statement for the request server.instance.ToSend.AddLast(("%CATEGORYITEMRT|~END", client)); } //Processes a request for category item data public void CategoryItemDataRequest(ServerClient client, long id) { + //Reads the category items from the database List data = dbManager.instance.ReadValuesInStockTable(id, ""); + + //Cycle through each piece of data foreach(Item item in data) { + //Send each piece of data to the client that requested the lookup string toSend = "%CATEGORYITEMNAMERT|" + item.id + "|" + item.name + "|" + item.price + "|" + item.type; server.instance.ToSend.AddLast((toSend, client)); } - //server.instance.toSend.AddLast(("%CATEGORYITEMNAMERT|~END", client)); - } //Processes a staff login request public void StaffLoginRequest(ServerClient client, int staffID) { + //Reads the category items from the database List data = dbManager.instance.ReadStaffMembersInTable(staffID, "", ""); - foreach(StaffMember sm in data) + + //Cycle through each piece of data + foreach (StaffMember sm in data) { + //Send each piece of data to the client that requested the lookup string toSend = "%STAFFLOGINRT|" + sm.staffID.ToString() + "|" + sm.lastName + "|" + sm.firstName + "|" + sm.dateOfBirth + "|" + sm.startDate + "|" + sm.endDate + "|" + sm.permissionLevel.ToString(); server.instance.ToSend.AddLast((toSend, client)); } + + //Send the closing statement for the request server.instance.ToSend.AddLast(("%STAFFLOGINRT|~END", client)); } @@ -91,20 +112,21 @@ public void StaffLoginRequest(ServerClient client, int staffID) public void WriteTransactionData(ServerClient client, Transaction transToAdd) { dbManager.instance.InsertValuesIntoTransTable(transToAdd.transactionID, transToAdd.transactionDateTime, transToAdd.transactionAmount, transToAdd.paymentType, transToAdd.staffID); - //server.instance.toSend.AddLast(("%TRANSACTIONWRITERT|~COMPLETE", client)); } //Processes a transaction item write request public void WriteTransactionItemData(ServerClient client, long transId, long itemID, int quantity, float itemPrice) { dbManager.instance.InsertValuesIntoTransItemTable(transId, itemID, quantity, itemPrice); - //server.instance.toSend.AddLast(("%TRANSACTIONWRITERT|~COMPLETE", client)); } //Processes an authorising staff member request public void AuthStaffMemberData(ServerClient client, int idToSearch) { + //Reads the category items from the database List data = dbManager.instance.ReadStaffMembersInTable(idToSearch, "", ""); + + //Send the data to the client that requested the lookup string toSend = "%AUTHSTAFFRT|" + data[0].staffID.ToString() + "|" + data[0].lastName + "|" + data[0].firstName + "|" + data[0].dateOfBirth + "|" + data[0].startDate + "|" + data[0].endDate + "|" + data[0].permissionLevel.ToString(); server.instance.ToSend.AddLast((toSend, client)); } @@ -113,7 +135,6 @@ public void AuthStaffMemberData(ServerClient client, int idToSearch) public void WriteStockItem(ServerClient client, long id, string name, float price, int type) { dbManager.instance.InsertValueIntoStockTable(id, name, price, type); - } //Processes a write staff member request diff --git a/Scripts/Till Functions/ClientController.cs b/Scripts/Till Functions/ClientController.cs index 0d84bd46..0040eb1b 100644 --- a/Scripts/Till Functions/ClientController.cs +++ b/Scripts/Till Functions/ClientController.cs @@ -74,7 +74,6 @@ public void CalculateSubTotal() { orderSubTotal += kvp.Key.price * kvp.Value; } - //orderSubTotal = (float)(System.Math.Round(orderSubTotal, 3)); subTotalText.text = "Sub-Total: £" + orderSubTotal.ToString("0.00"); } diff --git a/Scripts/Till Functions/OrderButtonController.cs b/Scripts/Till Functions/OrderButtonController.cs index 9322afe2..7fc97bb1 100644 --- a/Scripts/Till Functions/OrderButtonController.cs +++ b/Scripts/Till Functions/OrderButtonController.cs @@ -34,7 +34,6 @@ public void UpdateButton() if(clientController.instance.selectedItem == item) { gameObject.GetComponent().color = new Color(210, 210, 210); - //gameObject.GetComponent