public ManageNonLocatedSTLT(IGTCustomCommandHelper customCommandHelper, IGTTransactionManager gtTransaction) : this() { this._gtCustomCommandHelper = customCommandHelper; this._gtTransactionManager = gtTransaction; if (isJobActive) { _gtFeatureExplorerSrvc = GTClassFactory.Create <IGTFeatureExplorerService>(_gtCustomCommandHelper); _gtFeatureExplorerSrvc.Locked = false; } //Subscrive eventds SubscribEvents(true); }
public void Activate(IGTCustomCommandHelper CustomCommandHelper) { try { m_oGTApp = GTClassFactory.Create <IGTApplication>(); m_oGTCustomCommandHelper = CustomCommandHelper; if (Validate()) { if (m_oGTExplorerService == null) { m_oGTExplorerService = GTClassFactory.Create <IGTFeatureExplorerService>(m_oGTCustomCommandHelper); } m_oGTExplorerService.Slide(true); if (m_oGTPlacementService == null) { m_oGTPlacementService = GTClassFactory.Create <IGTFeaturePlacementService>(m_oGTCustomCommandHelper); } if (!m_oGTTransactionManager.TransactionInProgress) { m_oGTTransactionManager.Begin("Tree Trimming Request Estimate"); } m_oStatusBarMessage = "Draw a polygon encompassing all affected Work Points"; SubscribeEvents(); m_oGTTreeTrimmingfeature = m_oGTApp.DataContext.NewFeature(190); m_oGTPlacementService.StartFeature(m_oGTTreeTrimmingfeature); } else { ExitCommand(); } } catch (Exception ex) { m_oGTExplorerService_CancelClick(null, EventArgs.Empty); if (m_oGTTransactionManager.TransactionInProgress) { m_oGTTransactionManager.Rollback(); } MessageBox.Show("Error in TreeTrim Request Estimate command: " + ex.Message, "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Error); ExitCommand(); } }
private bool ProcessCUUpdate(bool flagCUModified, ref short nCompNO, ref string sFilterFieldName) { string sCUFieldName = ""; int changeOutCid = m_oFeature.CID; if (flagCUModified) { IGTFeatureExplorerService mFEservice = GTClassFactory.Create <IGTFeatureExplorerService>(); if (GetCompFieldNameByANO(m_sCUano, m_oFeature.FNO, ref nCompNO, ref sCUFieldName)) //As the CU field is same for Primary or Ancillary component, there is no difference whether we pass Primary CU ANO or Ancillary CU ANO { if (!(m_oFeature.Components.GetComponent(nCompNO).Recordset == null)) { // FeatureExplorerService is called to refresh all Dialog tabs of the feature string stablename; string sDiaType; stablename = GetPrimaryComponentTable(m_oFeature.FNO); if (IsPlacementMode(m_oFeature.FNO, m_oFeature.FID, stablename)) { if (m_sDialogNo == "") { mFEservice.ExploreFeature(m_oFeature, "Placement"); } else { sDiaType = GetDialogType(m_sDialogNo); mFEservice.ExploreFeature(m_oFeature, sDiaType); } } else { mFEservice.ExploreFeature(m_oFeature, "Edit"); CopyPhaseAndPositionFromChangeoutInstance(changeOutCid); mFEservice.ExploreFeature(m_oFeature, "Edit"); } } } return(true); } else { return(false); } }
/// <summary> /// Activates the install service process. Creates the new service line and sets up the listeners. /// </summary> /// <param name="CustomCommandHelper"></param> public void Activate(IGTCustomCommandHelper CustomCommandHelper) { try { if (gtTransactionManager != null) { serviceLine = null; dataContext = m_gtApp.DataContext; customCommandHelper = CustomCommandHelper; featurePlacementService = GTClassFactory.Create <IGTFeaturePlacementService>(customCommandHelper); featureExplorerService = GTClassFactory.Create <IGTFeatureExplorerService>(); featureExplorerVisible = featureExplorerService.Visible; SubscribeEvents(); placeServiceLine(); } }catch (Exception e) { } }
/// <summary> /// Ends the process. /// </summary> public void Terminate() { dataContext = null; gtTransactionManager = null; UnsubscribeEvents(); customCommandHelper = null; if (featurePlacementService != null) { featurePlacementService.Dispose(); featurePlacementService = null; } if (featureExplorerService != null) { featureExplorerService.Clear(); featureExplorerService.Dispose(); featureExplorerService = null; } m_gtApp.EndWaitCursor(); }
private void ExploreFeatures() { // Similar to the product's dialog, if multiple rows are selected, // the system does not explore or select the features. if(1 == this.dgvErrors.SelectedRows.Count) { IGTFeatureExplorerService fes = GTClassFactory.Create<IGTFeatureExplorerService>(); IGTApplication app = GTClassFactory.Create<IGTApplication>(); DataGridViewRow row = this.dgvErrors.SelectedRows[0]; short FNO = Convert.ToInt16(row.Cells[colFNO.Index].Value); int FID = Convert.ToInt32(row.Cells[colFID.Index].Value); IGTKeyObject keyObject = app.DataContext.OpenFeature(FNO, FID); fes.ExploreFeature(keyObject, "Review"); app.SelectedObjects.Clear(); IGTDDCKeyObjects ddcKeyobjects = app.DataContext.GetDDCKeyObjects(FNO, FID, GTComponentGeometryConstants.gtddcgAllGeographic); app.SelectedObjects.Add(GTSelectModeConstants.gtsosmAllComponentsInActiveLegend, ddcKeyobjects[0]); fes.Visible = true; } }
/// <summary> /// Method to Exit the command. /// </summary> private void ExitCommand() { try { m_oGTApp.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, ""); if (m_oEventsSubscribed) { UnsubscribeEvents(); } if (m_oGTCustomCommandHelper != null) { m_oGTCustomCommandHelper.Complete(); m_oGTCustomCommandHelper = null; } } catch { throw; } finally { if (m_oGTCustomCommandHelper != null) { m_oGTCustomCommandHelper = null; } if (m_oGTTransactionManager != null) { m_oGTTransactionManager = null; } if (m_oGTExplorerService != null) { m_oGTExplorerService.Dispose(); m_oGTExplorerService = null; } if (m_oGTPlacementService != null) { m_oGTPlacementService.Dispose(); m_oGTPlacementService = null; } } }
/// <summary> /// Method to Query the Voucher FERCAccount and Sub Account data required to load ForeignKeyQuery form. /// </summary> private void QueryVoucherFERCAccount() { Recordset workpointAttributeRS = null; string activeWR = null; string fkqConfiguredAttribute = null; try { fkqConfiguredAttribute = Convert.ToString(Arguments.GetArgument(0)); activeWR = m_gtApplication.DataContext.ActiveJob; workpointAttributeRS = DataContext.OpenRecordset(String.Format("SELECT DISTINCT PRIME_ACCT_ID,SUB_ACCT,ACCT_DESC,CU.G3E_FID,CU.ASSOC_FNO FROM WORKPOINT_CU_N CU,WORKPOINT_N WP,REFWMIS_FERC_ACCOUNT REF WHERE CU.G3E_FID=WP.G3E_FID AND WP.WR_NBR='{0}' AND REF.PRIME_ACCT=CU.PRIME_ACCT_ID AND REF.ACTIVITY_C=CU.ACTIVITY_C", activeWR), CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockReadOnly, (int)CommandTypeEnum.adCmdText); using (VoucherFERCAccountForm voucherFERCAccountForm = new VoucherFERCAccountForm(workpointAttributeRS, m_gtFeature, fkqConfiguredAttribute, m_gtReadOnly)) { voucherFERCAccountForm.StartPosition = FormStartPosition.CenterScreen; voucherFERCAccountForm.ShowDialog(m_gtApplication.ApplicationWindow); if (voucherFERCAccountForm.AccountValue != null && !m_gtReadOnly) { IGTFeatureExplorerService mFEservice = GTClassFactory.Create <IGTFeatureExplorerService>(); mFEservice.ExploreFeature(m_gtFeature, "Edit"); } //m_gtOutputValue.FieldValue = voucherFERCAccountForm.AccountValue; } } catch { throw; } finally { if (workpointAttributeRS != null) { workpointAttributeRS = null; } } }
/// <summary> /// /// </summary> private void CleanUp() { SubscribEvents(false); if (_gtFeatureExplorerSrvc != null) { _gtFeatureExplorerSrvc.Clear(); _gtFeatureExplorerSrvc.Dispose(); _gtFeatureExplorerSrvc = null; } if (_gtPlacementSrvc != null) { _gtPlacementSrvc.Dispose(); _gtPlacementSrvc = null; } streetLights = null; if (stltNonLocatedCtx != null) { stltNonLocatedCtx.Dispose(); } stltNonLocatedCtx = null; streetLightAcct = null; _gtKeyObj = null; _gtKeyEditObj = null; }