Пример #1
0
        private void ProcessWPSync(IGTDDCKeyObject selectedObject)
        {
            try
            {
                WorkPointOperations oWorkPointOperations = null;
                IGTComponents       gTComponents         = GTClassFactory.Create <IGTComponents>();
                IGTKeyObject        feature       = m_iGtApplication.DataContext.OpenFeature(selectedObject.FNO, selectedObject.FID);
                Recordset           cuComponentRs = feature.Components.GetComponent(21).Recordset;
                if (cuComponentRs != null && cuComponentRs.RecordCount > 0)
                {
                    gTComponents.Add(feature.Components.GetComponent(21));
                }
                // Set Activity in Ancillary CU attributes
                if (feature.Components.GetComponent(22) != null)
                {
                    Recordset acuComponentRs = feature.Components.GetComponent(22).Recordset;
                    if (acuComponentRs != null && acuComponentRs.RecordCount > 0)
                    {
                        gTComponents.Add(feature.Components.GetComponent(22));
                    }
                }

                // Synchronize the workpoint
                oWorkPointOperations = new WorkPointOperations(gTComponents, feature, m_DataContext);
                oWorkPointOperations.DoWorkpointOperations();
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        private void SynchronizeWP(IGTKeyObject p_KeyObjectFeature)
        {
            try
            {
                m_oGTTransactionManager.Begin("Synchronize WorkPoints for Repeat Reconductoring Feature =" + p_KeyObjectFeature.FNO.ToString() + " FID = " + p_KeyObjectFeature.FID.ToString());

                IGTComponents CUComponentsOldFeature = GTClassFactory.Create <IGTComponents>();

                foreach (IGTComponent item in p_KeyObjectFeature.Components)
                {
                    if (item.CNO == 21 || item.CNO == 22)
                    {
                        CUComponentsOldFeature.Add(item);
                    }
                }
                WorkPointOperations obj = new WorkPointOperations(CUComponentsOldFeature, p_KeyObjectFeature, m_iGtApplication.DataContext);
                obj.DoWorkpointOperations();

                m_oGTTransactionManager.Commit();
                m_oGTTransactionManager.RefreshDatabaseChanges();
            }
            catch (Exception ex)
            {
                if (m_oGTTransactionManager.TransactionInProgress)
                {
                    m_oGTTransactionManager.Rollback();
                }
                throw ex;
            }
        }
Пример #3
0
        /// <summary>
        /// Process Accounting Impact validation
        /// </summary>
        /// <returns>true if the process is complete without errors, else returns false</returns>
        public bool Process()
        {
            try
            {
                Dictionary <IGTKeyObject, IGTComponents> oDicFeatureCollection = new Dictionary <IGTKeyObject, IGTComponents>();
                oDicFeatureCollection = GetComponentsChangedCollection(Features);

                if (oDicFeatureCollection.Count > 0)
                {
                    oWorkPointOperations = new WorkPointOperations(null, null, DataContext, oDicFeatureCollection);
                    oWorkPointOperations.DoWorkpointOperations();

                    if (oWorkPointOperations.CUCompModified)
                    {
                        UpdateWritebackFlagAndAlternateDesigns();
                    }

                    RemoveCorrectionModeProperty();
                }
                return(true);
            }
            catch (Exception ex)
            {
                //MessageBox.Show("Error during execution of Accounting Impact FV." + Environment.NewLine + ex.Message,
                // "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw ex;
            }
        }
Пример #4
0
        /// <summary>
        /// Method for Workpoint operations after command execution
        /// </summary>
        private void SynchronizeWP()
        {
            IGTComponents allCUComponents = null;

            try
            {
                foreach (IGTDDCKeyObject ddcobject in m_ooddcKeyObjects)
                {
                    m_ofeature = m_oGTApp.Application.DataContext.OpenFeature(ddcobject.FNO, ddcobject.FID);

                    allCUComponents = GTClassFactory.Create <IGTComponents>();

                    if (m_ofeature != null)
                    {
                        GetAllCUComponents(m_ofeature, ref allCUComponents);

                        if (allCUComponents.Count > 0)
                        {
                            WorkPointOperations oWorkPointOperations = new WorkPointOperations(allCUComponents, m_ofeature, m_oGTApp.Application.DataContext);
                            oWorkPointOperations.DoWorkpointOperations();
                        }
                    }
                }
            }
            catch
            {
                throw;
            }
        }
Пример #5
0
        private void SynchronizeWP()
        {
            try
            {
                foreach (IGTDDCKeyObject ddcObject in m_selectedObjects)
                {
                    m_oGTTransactionManager.Begin("Process Synchronize WorkPoints for Copy Ancillary =" + ddcObject.FNO.ToString() + " FID = " + ddcObject.FID.ToString());

                    IGTKeyObject feature = m_dataContext.OpenFeature(ddcObject.FNO, ddcObject.FID);

                    IGTComponents CUComponentsFeature = GTClassFactory.Create <IGTComponents>();

                    foreach (IGTComponent item in feature.Components)
                    {
                        if (item.CNO == 22)
                        {
                            CUComponentsFeature.Add(item);
                        }
                    }
                    WorkPointOperations obj = new WorkPointOperations(CUComponentsFeature, feature, m_dataContext);
                    obj.DoWorkpointOperations();

                    m_oGTTransactionManager.Commit();
                    m_oGTTransactionManager.RefreshDatabaseChanges();
                }
            }
            catch
            {
                throw;
            }
        }
Пример #6
0
        public void SynchronizeWP(IGTKeyObject p_keyObject)
        {
            IGTComponents CUComponentsNewFeature = GTClassFactory.Create <IGTComponents>();

            foreach (IGTComponent item in p_keyObject.Components)
            {
                if (item.CNO == 21 || item.CNO == 22)
                {
                    CUComponentsNewFeature.Add(item);
                }
            }
            WorkPointOperations obj = new WorkPointOperations(CUComponentsNewFeature, p_keyObject, m_dataContext);

            obj.DoWorkpointOperations();
        }