コード例 #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);
            }
        }