public void add(iTool aTool) // add a new tool to the system { iToolCollection currentToolCollection = MainMenu.currentToolType; Console.WriteLine(aTool.ToString()); currentToolCollection.add(aTool); }
public void delete(iTool aTool) //delte a given tool from the system { iToolCollection currentToolCollection = MainMenu.currentToolType; Console.WriteLine(aTool.ToString()); currentToolCollection.delete(aTool); }
private static void navigateToolMenu(out string toolTypeStr, iToolLibrarySystem libary) { iToolCollection[,] toolMatrix = Program.aCollection.GetToolMatrix; int toolCategory, toolType; toolCategory = ToolCategories(); toolType = ToolTypes(toolCategory, out toolTypeStr); currentToolType = toolMatrix[toolCategory - 1, toolType - 1]; libary.displayTools(toolTypeStr); }
public void delete(iTool aTool, int quantity) { iToolCollection currentToolCollection = MainMenu.currentToolType; List <iTool> toolList = currentToolCollection.ToolCollectionList; iTool[] toolArray = currentToolCollection.toArray(); int i = 0; foreach (var tool in toolArray) { if (tool.Name == aTool.Name) { break; } i++; } toolList[i].Quantity = -quantity; }
public void add(iTool aTool, int quantity) //add new pieces of an existing tool to the system { iToolCollection currentToolCollection = MainMenu.currentToolType; List <iTool> toolList = currentToolCollection.ToolCollectionList; iTool[] toolArray = currentToolCollection.toArray(); int i = 0; foreach (var tool in toolArray) { if (tool.Name == aTool.Name) { break; } i++; } toolList[i].Quantity = quantity; }