コード例 #1
0
        private void AddNewDetail()
        {
            GeneralInformationControl.ApplyChanges(_addedComponent);
            CompliancePerformanceListControl.ApplyChanges(_addedComponent);

            if (_isStore)
            {
                if (_destinationObject is Store)
                {
                    GlobalObjects.ComponentCore.AddComponent(_addedComponent, (Store)_destinationObject,
                                                             GeneralInformationControl.InstallationDate,
                                                             GeneralInformationControl.Position, GeneralInformationControl.State, GeneralInformationControl.ComponentTCSNOnInstall,
                                                             GeneralInformationControl.ComponentCurrentTSNCSN, GeneralInformationControl.DateAsOf, true);
                }
                if (_destinationObject is Operator)
                {
                    GlobalObjects.ComponentCore.AddComponent(_addedComponent, (Operator)_destinationObject,
                                                             GeneralInformationControl.InstallationDate,
                                                             GeneralInformationControl.Position, GeneralInformationControl.State, GeneralInformationControl.ComponentTCSNOnInstall,
                                                             GeneralInformationControl.ComponentCurrentTSNCSN, GeneralInformationControl.DateAsOf, true);
                }
            }
            else
            {
                _parentBaseComponent = addNewComponentControl1.BaseComponentAddTo;
                GlobalObjects.ComponentCore.AddComponent(_addedComponent, _parentBaseComponent, GeneralInformationControl.InstallationDate,
                                                         GeneralInformationControl.Position, GeneralInformationControl.State, GeneralInformationControl.ComponentTCSNOnInstall,
                                                         GeneralInformationControl.ComponentCurrentTSNCSN, GeneralInformationControl.DateAsOf,
                                                         true);
            }
        }
コード例 #2
0
        /// <summary>
        /// Вызывается событие удаления отображаемого объекта
        /// </summary>
        /// <param name="arguments"></param>
        public override void OnDisplayerRemoving(DisplayerCancelEventArgs arguments)
        {
            if (_addedComponent != null && _addedComponent.ItemId <= 0 && GeneralInformationControl.GetChangeStatus())
            {
                switch (MessageBox.Show("Do you want to save changes?", (string)new GlobalTermsProvider()["SystemName"],
                                        MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1))
                {
                case DialogResult.Yes:
                    string message;
                    if (!ValidateData(out message))
                    {
                        message += "\nAbort operation";
                        MessageBox.Show(message, new GlobalTermsProvider()["SystemName"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        arguments.Cancel = true;
                    }
                    else
                    {
                        AddNewDetail();
                    }
                    break;

                case DialogResult.Cancel:
                    arguments.Cancel = true;
                    break;
                }
            }
            base.OnDisplayerRemoving(arguments);
        }
コード例 #3
0
        public override void DisposeScreen()
        {
            GeneralInformationControl.Dispose();

            CompliancePerformanceListControl.CancelAsync();

            Dispose(true);
        }
コード例 #4
0
        private void UpdateInformation()
        {
            if (_parentBaseComponent != null)
            {
                addNewComponentControl1.CurrentParent = _parentBaseComponent;
            }

            GeneralInformationControl.AddedComponent = _addedComponent;
            GeneralInformationControl.ParentObject   = _destinationObject;
            if (_parentBaseComponent != null)
            {
                GeneralInformationControl.UpdateComponentClass(_parentBaseComponent);
            }
            CompliancePerformanceListControl.CurrentComponent = _addedComponent;
        }
コード例 #5
0
        private void LabMainFormBetter_Load(object sender, EventArgs e)
        {
            labWelcomeControl      = new LabWelcomeControl();
            labWelcomeControl.Dock = DockStyle.Fill;

            generalInformationControl      = new GeneralInformationControl();
            generalInformationControl.Dock = DockStyle.Fill;

            safetyControl      = new SafetyControl();
            safetyControl.Dock = DockStyle.Fill;

            chemicalAgentControl      = new ChemicalAgentControl();
            chemicalAgentControl.Dock = DockStyle.Fill;

            biologicalAgentControl      = new BiologicalAgentsControl();
            biologicalAgentControl.Dock = DockStyle.Fill;

            mechanicalAgentControl      = new MechanicalAgentControl();
            mechanicalAgentControl.Dock = DockStyle.Fill;

            physicalAgentControl      = new PhysicalAgentsControl();
            physicalAgentControl.Dock = DockStyle.Fill;

            riskAnalysisControl      = new RiskAnalysisControl();
            riskAnalysisControl.Dock = DockStyle.Fill;

            conclusionControl      = new ConclusionControl();
            conclusionControl.Dock = DockStyle.Fill;

            //

            activeControlPanel.Controls.Add(labWelcomeControl);
            welcomeTabButton.BackColor = Color.DarkGray;

            progress = 1;
            data     = new Data.Lab();
        }
コード例 #6
0
 private void ClearFields()
 {
     GeneralInformationControl.ClearFields();
     CompliancePerformanceListControl.ClearFields();
 }
コード例 #7
0
 private void AddNewComponentControl1OnCheckedChanged(object sender, EventArgs eventArgs)
 {
     GeneralInformationControl.UpdateComponentClass(sender as BaseComponent);
 }