示例#1
0
        public static void clickOnTreeOperations(TreeNodeMouseClickEventArgs e, MainForm form)
        {
            int idOperation          = e.Node.Index;
            int indexSelectedSurface = StorageOfSelectedOperation.getIndexSelectedSurface();

            Operation operation;

            if (indexSelectedSurface == 0)
            {
                operation = extractionOfParametersOfOperationsFromTables(idOperation);
            }
            else
            {
                operation = extractionOfParametersOfOperationsFromTechnologicalProcess(idOperation);
            }

            StorageOfSelectedOperation.setOperation(operation);
            StorageOfSelectedOperation.insertParametersOfOperationsInTextboxes(form);
        }
        public static void clickOnNode(TreeNodeMouseClickEventArgs e, MainForm form)
        {
            int selectedIndex = e.Node.Index;

            StorageOfSelectedOperation.setIndexSelectedOperation(selectedIndex);

            if (selectedIndex == 0)
            {
                EventClickOnButtonOfSelectWorkpriece.buttonSelectWorkpriece(form);
            }
            else
            {
                int index             = selectedIndex - 1;
                int idSelectedSurface = StorageOfSelectedOperation.getIndexSelectedSurface();

                Operation operation = Part.getSurfaceOnIndex(idSelectedSurface).getOperationOnIndex(index);
                StorageOfSelectedOperation.setOperation(operation);

                StorageOfSelectedOperation.insertParametersOfOperationsInTextboxes(form);
            }
        }
        public static void buttonOfSelectOperations(MainForm form)
        {
            Operation operation = StorageOfSelectedOperation.getOperation();

            if (operation != null)
            {
                extractionOfParametersOfOperationFromTextBoxes(operation, form);

                int indexSelectedOperation = StorageOfSelectedOperation.getIndexSelectedOperation();
                int indexSelectedSurface   = StorageOfSelectedOperation.getIndexSelectedSurface();

                Part.addOperationInSurface(operation, indexSelectedSurface, indexSelectedOperation);

                insertNameOperationInTextboxes(form, operation.getTypeOfMachining(), indexSelectedOperation);

                operation = new Operation(operation);
                StorageOfSelectedOperation.setOperation(operation);
            }

            /*ParametersOperation operation = StorageOfSelectedOperation.getOperation();
             *
             * if (operation != null)
             * {
             *  extractionOfParametersOfOperationFromTextBoxes(operation, form);
             *
             *  int indexSelectedOperation = StorageOfSelectedOperation.getIndexSelectedOperation();
             *  int indexSelectedSurface = StorageOfSelectedOperation.getIndexSelectedSurface();
             *
             *  Part.addOperationInSurface(operation, indexSelectedSurface, indexSelectedOperation);
             *
             *  insertNameOperationInTextboxes(form, operation.getNameOperation(), indexSelectedOperation);
             *
             *  operation = new ParametersOperation(operation);
             *  StorageOfSelectedOperation.setParameters(operation);
             * }*/
        }