Exemplo n.º 1
0
        public static void buttonAddSurface(MainForm form)
        {
            try
            {
                TreeNode surface = new TreeNode();

                int count = form.SurfacesTreeView.Nodes.Count;

                Part.copyTechnologicalProcessInSurface(count);
                Part.insertListOfOperationsInTreeView(form, count);

                surface.Name = "notChange";
                surface.Text = "Поверхность " + Convert.ToString(count);


                form.SurfacesTreeView.Nodes.Add(surface);

                StorageOfSelectedOperation.setIndexSelectedSurface(count);
                form.SurfacesTreeView.SelectedNode = form.SurfacesTreeView.Nodes[count];

                form.NameSurface.Text = surface.Text;
                Part.getSurfaceOnIndex(count).setNameSurface(surface.Text);
            }
            catch { }
        }
Exemplo n.º 2
0
        public static void buttonSelectProcess(MainForm form)
        {
            string nameSurface = "Поверхность 1";
            int    countNodes  = form.SurfacesTreeView.Nodes.Count;

            distributionIdOnTechnologicalProcess(Part.getSurfaceOnIndex(0).getOperations());

            if (countNodes == 1)
            {
                form.SurfacesTreeView.Nodes.Add("notChange", nameSurface);

                Part.setNameSurfaceOnIndex(1, nameSurface);
                Part.copyTechnologicalProcessInSurface(1);
            }

            StorageOfSelectedOperation.setIndexSelectedSurface(1);
            form.SurfacesTreeView.SelectedNode = form.SurfacesTreeView.Nodes[1];

            form.NameSurface.Text = nameSurface;

            Part.insertListOfOperationsInTreeView(form, 1);
            Part.insertListOfTechnologicalProcessInTreeView(form);

            enabledTextBoxes(form);
        }
Exemplo n.º 3
0
        public static void insertNameOperationsInTreeView(MainForm form)
        {
            Part.insertListOfOperationsInTreeView(form, 0);

            int countOperations = form.TreeOfSelectedOperations.Nodes.Count;

            form.TreeOfSelectedOperations.SelectedNode = form.TreeOfSelectedOperations.Nodes[countOperations - 1];
            form.SurfacesTreeView.SelectedNode         = form.SurfacesTreeView.Nodes[0];
        }
        private static void insertPartInMainForm(FormOfWorkWithDatabase form)
        {
            Part.insertListOfSurfacess(form.parrentForm);
            Part.insertParametersOfPartInTextboxes(form.parrentForm);
            Part.insertListOfOperationsInTreeView(form.parrentForm);

            EventClickOnButtonOfSelectWorkpriece.enabledTextBoxes(form.parrentForm);

            form.parrentForm.SurfacesTreeView.SelectedNode = form.parrentForm.SurfacesTreeView.Nodes[0];
        }
Exemplo n.º 5
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("Выбранная запись поврежденна", "Ошибка"); }
        }
Exemplo n.º 6
0
        public static void clickOnNode(TreeNodeMouseClickEventArgs e, MainForm form)
        {
            int selectedIndex = e.Node.Index;

            //storageParametersOfSurface(form, selectedIndex);

            StorageOfSelectedOperation.setIndexSelectedSurface(selectedIndex);
            form.NameSurface.Text = Part.getSurfaceOnIndex(selectedIndex).getNameSurface();

            if (selectedIndex == 0)
            {
                StorageOfSelectedOperation.setIndexSelectedSurface(0);
                form.SurfacesTreeView.SelectedNode = form.SurfacesTreeView.Nodes[0];
                Part.insertListOfOperationsInTreeView(form);
                form.TreeOfOperations.Nodes.Clear();
                Tables.getParametersOfSurfacesAfterVariousOperations().insertListOfOperationsInTreeView(form);

                form.Surfaces.Visible         = false;
                form.NameSurface.Visible      = false;
                form.SurfacesTreeView.Visible = false;
                form.addSurfaceButton.Visible = false;
                form.delSurfaceButton.Visible = false;

                form.TreeOfOperations.Size     = new Size(400, 287);
                form.TreeOfOperations.Location = new Point(16, 270);

                form.labelOperationsOrTechProcess.Size     = new Size(91, 13);
                form.labelOperationsOrTechProcess.Location = new Point(169, 250);
                form.labelOperationsOrTechProcess.Text     = "Выбор операций";


                form.SelectTechnologicalProcess.Visible = true;
                form.CalculationOfSchema.Visible        = false;
            }
            else
            {
                int indexSelectSurface = StorageOfSelectedOperation.getIndexSelectedSurface();

                Part.insertListOfOperationsInTreeView(form, indexSelectSurface);

                int countOperations = form.TreeOfSelectedOperations.Nodes.Count;
                form.TreeOfSelectedOperations.SelectedNode = form.TreeOfSelectedOperations.Nodes[countOperations - 1];
            }
        }
 private static void insertNameOperationInTreeView(MainForm form, int selectedOperation)
 {
     Part.insertListOfOperationsInTreeView(form);
 }