Example #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (plowMachineDataGridView.SelectedRows.Count != 0)
            {
                PlowMachine pm = (PlowMachine)plowMachineDataGridView.SelectedRows[0].DataBoundItem;

                pm = _manager.LoadPlowMachine(pm.PlowMachineId);

                if (pm.IsPrototype)
                    if (DialogResult.Yes == MessageBox.Show("Вы хотите использовать прототип в качестве основы для новой СУ?", "", MessageBoxButtons.YesNo))
                    {
                        pm = _manager.ClonePlowMachine(pm);

                        string pmname = string.Empty;

                        using (Dialogs.NameDialog name = new Su.Dialogs.NameDialog())
                        {
                            name.ShowDialog();
                            pmname = name.EnteredText;
                        }

                        pm.Name = pmname;
                    }
                    else
                    {
                        pm = null;
                    }

                SelectedPlowMachine = pm;

            }

            DialogResult = DialogResult.OK;
            Close();
        }
Example #2
0
        public void New()
        {
            string pmname = string.Empty;
            using (Dialogs.NameDialog name = new Su.Dialogs.NameDialog())
            {
                name.ShowDialog();
                pmname = name.EnteredText;
            }

            plowMachineBaseView1.CreteNewPlowMachine();
            plowMachineBaseView1.CurrentPlowMachine.Name = pmname;
            plowMachineBaseView1.RefreshView();

            pluginsView1.PlowMachine = plowMachineBaseView1.CurrentPlowMachine;
            computingProcessorControl1.PlowMachine = plowMachineBaseView1.CurrentPlowMachine;
        }