Exemple #1
0
        public static void buttonSelectPartInFormOfWorkWithDatabase(FormOfWorkWithDatabase form, MainForm parrentForm)
        {
            try
            {
                insertParametersOfPart(form, parrentForm);
                Part.insertParametersOfPartInTextboxes(parrentForm);

                insertParametersOfWorkpriece(form);
                Part.insertNameOfWorkpieceInTreeViewAndTextBox(parrentForm);

                insertParametersOfOperations(form);
                Part.insertListOfOperationsInTreeView(parrentForm);

                form.Close();
            }

            catch { MessageBox.Show("Выбранная запись поврежденна", "Ошибка"); }
        }
Exemple #2
0
        public void insertListOfOperationsInTreeView(MainForm form)
        {
            string[] listOfSurface      = this.getListOperations();
            int      numberOfOperations = this.getCountShortListOperation();

            form.TreeOfSelectedOperations.Nodes.Clear();
            Part.insertNameOfWorkpieceInTreeViewAndTextBox(form);

            for (int i = 1; i <= numberOfOperations; i++)
            {
                if (form.TreeOfSelectedOperations.Nodes.Count <= i)
                {
                    form.TreeOfSelectedOperations.Nodes.Add(listOfSurface[i - 1]);
                }
                else
                {
                    form.TreeOfSelectedOperations.Nodes[i].Text = listOfSurface[i - 1];
                }
            }

            StorageOfSelectedOperation.setIndexSelectedOperation(numberOfOperations);
            form.TreeOfSelectedOperations.SelectedNode = form.TreeOfSelectedOperations.Nodes[numberOfOperations];
        }