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; } }
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; } }
/// <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; } }
/// <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; } }
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; } }
/// <summary> /// Method to set the activity attribute of the CU and ACU components /// </summary> /// <param name="selectedObject">Selected feature on map window</param> private void SetActivity(IGTDDCKeyObject selectedObject) { Recordset cuComponentRs = null; Recordset acuComponentRs = null; WorkPointOperations oWorkPointOperations = null; IGTComponents gTComponents = GTClassFactory.Create <IGTComponents>(); try { IGTKeyObject feature = m_iGtApplication.DataContext.OpenFeature(selectedObject.FNO, selectedObject.FID); // Set Activity in CU attributes cuComponentRs = feature.Components.GetComponent(21).Recordset; if (cuComponentRs != null && cuComponentRs.RecordCount > 0) { gTComponents.Add(feature.Components.GetComponent(21)); cuComponentRs.MoveFirst(); while (!cuComponentRs.EOF) { cuComponentRs.Fields["ACTIVITY_C"].Value = "A"; cuComponentRs.MoveNext(); } } // Set Activity in Ancillary CU attributes if (feature.Components.GetComponent(22) != null) { acuComponentRs = feature.Components.GetComponent(22).Recordset; if (acuComponentRs != null && acuComponentRs.RecordCount > 0) { gTComponents.Add(feature.Components.GetComponent(22)); acuComponentRs.MoveFirst(); while (!acuComponentRs.EOF) { string retiremenType = Convert.ToString(acuComponentRs.Fields["RETIREMENT_C"].Value); if (retiremenType == "1" || retiremenType == "2") { acuComponentRs.Fields["ACTIVITY_C"].Value = "R"; } acuComponentRs.MoveNext(); } } } //// Synchronize the workpoint //oWorkPointOperations = new WorkPointOperations(gTComponents, feature, m_DataContext); //oWorkPointOperations.DoWorkpointOperations(); } catch (Exception) { throw; } }
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(); }