Пример #1
0
        public void add(iTool aTool) // add a new tool to the system
        {
            iToolCollection currentToolCollection = MainMenu.currentToolType;

            Console.WriteLine(aTool.ToString());
            currentToolCollection.add(aTool);
        }
Пример #2
0
        public void delete(iTool aTool) //delte a given tool from the system
        {
            iToolCollection currentToolCollection = MainMenu.currentToolType;

            Console.WriteLine(aTool.ToString());
            currentToolCollection.delete(aTool);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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;
        }
Пример #5
0
        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;
        }