コード例 #1
0
 public void Terminate()
 {
     transactionManager.Commit();
     transactionManager  = null;
     dataContext         = null;
     customCommandHelper = null;
 }
コード例 #2
0
        /// <summary>
        /// Method to Exit the command.
        /// </summary>
        private void ExitCommand()
        {
            try
            {
                try
                {
                    if (m_oGTApp.Application.Properties.Count > 0)
                    {
                        m_oGTApp.Application.Properties.Remove("StreetLightImportToolMSFID");
                    }
                }
                catch
                {
                }

                if (m_oGTCustomCommandHelper != null)
                {
                    m_oGTCustomCommandHelper.Complete();
                    m_oGTCustomCommandHelper = null;
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                m_oGTCustomCommandHelper = null;
                m_oGTTransactionManager  = null;
            }
        }
コード例 #3
0
        public void Activate()
        {
            string           featureState    = string.Empty;
            List <int>       fidList         = new List <int>();
            IGTDDCKeyObjects selectedObjects = GTClassFactory.Create <IGTDDCKeyObjects>();

            try
            {
                IGTDDCKeyObjects ddcKeyObjects = m_iGtApp.SelectedObjects.GetObjects();
                foreach (IGTDDCKeyObject ddcKeyObject in ddcKeyObjects)
                {
                    if (!fidList.Contains(ddcKeyObject.FID))
                    {
                        fidList.Add(ddcKeyObject.FID);
                        selectedObjects.Add(ddcKeyObject);
                    }
                }

                foreach (IGTDDCKeyObject selectedObject in selectedObjects)
                {
                    featureState = GetFeatureState(selectedObject);

                    if (string.IsNullOrEmpty(featureState) || !m_featureStatesList.Contains(featureState))
                    {
                        MessageBox.Show("One or more features are in an invalid feature state for this operation.", "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }

                if (!m_TransactionManager.TransactionInProgress)
                {
                    m_TransactionManager.Begin("updating feature state...");
                }
                int current    = 1;
                int totalCount = selectedObjects.Count;

                foreach (IGTDDCKeyObject selectedObject in selectedObjects)
                {
                    m_iGtApp.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Transitioning " + current + " out of " + totalCount + " features.");
                    SetFeatureState(selectedObject);
                    current++;
                }

                m_TransactionManager.Commit();
                m_TransactionManager.RefreshDatabaseChanges();

                m_iGtApp.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Selected features were transitioned successfully.");
            }
            catch (Exception ex)
            {
                m_TransactionManager.Rollback();
                MessageBox.Show("Error during execution of Complete Feature custom command." + ex.Message, "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                m_TransactionManager = null;
            }
        }
コード例 #4
0
        public SupplementalAgreementPresenter(ISupplementalAgreementView supplementalAgreementView, IGTCustomCommandHelper CustomCommandHelper
                                              , IGTTransactionManager gTTransactionManager)
        {
            m_view  = supplementalAgreementView;
            m_model = new Model.SupplementalAgreementModel(m_view.GTDataContext, m_view.GTDDCKeyObjects);

            m_gTCustomCommandHelper = CustomCommandHelper;
            m_oGTTransactionManager = gTTransactionManager;
        }
コード例 #5
0
 public StreetLightImportUtility(IGTDataContext p_oGTDataContext, bool p_Islocatable
                                 , IGTTransactionManager p_gTTransactionManager, IGTApplication p_gTApplication)
 {
     this.m_oGTDataContext       = p_oGTDataContext;
     this.m_Islocatable          = p_Islocatable;
     this.m_gTTransactionManager = p_gTTransactionManager;
     this.gTOwnerKeyObject       = null;
     this.m_gTApplication        = p_gTApplication;
     this.m_dataAccess           = new DataAccess(p_oGTDataContext, p_gTApplication);
 }
コード例 #6
0
 public AttachJobDocument(IGTApplication m_igtApplication, int m_designAreaFID, IGTTransactionManager m_igtranscation)
 {
     InitializeComponent();
     this.m_igtApplication = m_igtApplication;
     this.m_designAreaFID  = m_designAreaFID;
     this.m_igtranscation  = m_igtranscation;
     m_commonMessages      = new CommonMessages();
     getCommandParams();
     //addFileTypes();
 }
コード例 #7
0
 public void Terminate()
 {
     if (m_GTTransactionManager != null)
     {
         if (m_GTTransactionManager.TransactionInProgress)
         {
             m_GTTransactionManager.Rollback();
         }
     }
     m_GTTransactionManager = null;
 }
コード例 #8
0
ファイル: ManageNonLocatedSTLT.cs プロジェクト: git786hub/DLL
 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);
 }
コード例 #9
0
 public void Terminate()
 {
     try
     {
         if (m_oGTTransactionManager != null)
         {
             m_oGTTransactionManager = null;
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
コード例 #10
0
 public void Terminate()
 {
     try
     {
         m_TransactionManager  = null;
         m_CustomCommandHelper = null;
         frmStreetLightVoltageDrop.m_CustomCommandHelper = null;
         frmStreetLightVoltageDrop.m_TransactionManager  = null;
         frmStreetLightVoltageDrop = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show(m_Application.ApplicationWindow, ex.Message, ConstantsDT.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
コード例 #11
0
 public void Terminate()
 {
     try
     {
         m_TransactionManager  = null;
         m_CustomCommandHelper = null;
         m_frmSecondaryCalculator.m_CustomCommandHelper = null;
         m_frmSecondaryCalculator.m_TransactionManager  = null;
         m_frmSecondaryCalculator = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show(m_Application.ApplicationWindow, ex.Message, ConstantsDT.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
コード例 #12
0
 /// <summary>
 /// Command has terminated. Release the objects.
 /// </summary>
 public void Terminate()
 {
     try
     {
         m_Application         = null;
         m_TransactionManager  = null;
         m_CustomCommandHelper = null;
         frmCablePullTension.m_CustomCommandHelper = null;
         frmCablePullTension.m_TransactionManager  = null;
         frmCablePullTension = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show(m_Application.ApplicationWindow, "IGTCustomCommandModeless_Terminate:" + Environment.NewLine + "Error (" + ex.Source + ") - " + ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
コード例 #13
0
 /// <summary>
 /// Dispose all method before command exit
 /// </summary>
 private void CleanUp()
 {
     if (detectOverlappingAnalysis != null)
     {
         detectOverlappingAnalysis.Dispose();
     }
     detectOverlappingAnalysis = null;
     if (gtTransactionManager != null)
     {
         if (gtTransactionManager.TransactionInProgress)
         {
             gtTransactionManager.Rollback();
         }
     }
     gtTransactionManager = null;
 }
コード例 #14
0
        public ReviewAssetHistoryForm(AssetHistoryModel assetHistoryModel, IGTTransactionManager oGTTransactionManager, IGTCustomCommandHelper GTCustomCommandHelper)
        {
            try
            {
                m_dataGridViewColumnSelector = null;
                m_assetHistoryModel          = assetHistoryModel;
                m_oGTTransactionManager      = oGTTransactionManager;
                m_GTCustomCommandHelper      = GTCustomCommandHelper;

                InitializeComponent();

                if (!assetHistoryModel.m_DataContext.IsRoleGranted("ADMINISTRATOR"))
                {
                    btnSaveView.Visible = false;
                }
                if (m_assetHistoryModel.m_FID != 0 && !m_assetHistoryModel.m_isStructure)
                {
                    txtFid.Text = Convert.ToString(m_assetHistoryModel.m_FID);
                }

                LoadDatagridView(null);

                LoadComboBox();

                cmbNamedView.SelectedIndex = -1;

                m_dataGridViewColumnSelector = new DataGridViewColumnSelector(dgHistory, m_assetHistoryModel);

                if (dgHistory.Rows.Count > 0)
                {
                    btnSaveView.Enabled = true;
                    btnExport.Enabled   = true;
                }
                else
                {
                    btnSaveView.Enabled = false;
                    btnExport.Enabled   = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error during execution of Review Asset History custom command." + Environment.NewLine + ex.Message,
                                "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #15
0
 /// <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();
 }
コード例 #16
0
        public void Terminate()
        {
            try
            {
                UnsubscribeEvents();

                if (m_oEditService != null)
                {
                    if (m_oEditService.GeometryCount > 0)
                    {
                        m_oEditService.RemoveAllGeometries();
                    }
                }

                m_oGTApplication.Application.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "");
                if (m_oGTTransactionManager != null && m_oGTTransactionManager.TransactionInProgress)
                {
                    m_oGTTransactionManager.Rollback();
                    m_oGTTransactionManager.RefreshDatabaseChanges();
                }
                m_oGTApplication.EndWaitCursor();
                m_oGTApplication.SelectedObjects.Clear();
                m_oGTApplication.RefreshWindows();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex.Message, m_sMsgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                m_oGTApplication         = null;
                m_oGTCustomCommandHelper = null;
                m_osrcGeometry           = null;
                m_otrgFeature            = null;
                m_trgComponent           = null;
                m_oEditService           = null;
                m_oGTTransactionManager  = null;
                m_EditObjects            = null;
                m_locatedObjects         = null;
                m_snapPoint = null;
            }
        }
コード例 #17
0
ファイル: ccGuying.cs プロジェクト: git786hub/DLL
 public void Terminate()
 {
     try
     {
         m_Application                   = null;
         m_TransactionManager            = null;
         m_CustomCommandHelper           = null;
         m_EmbeddedDT.Application        = null;
         m_EmbeddedDT.TransactionManager = null;
         if (m_EmbeddedDT != null)
         {
             m_EmbeddedDT.Close();
             m_EmbeddedDT = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(m_Application.ApplicationWindow, ex.Message, ConstantsDT.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
コード例 #18
0
ファイル: ccRemoveFeature.cs プロジェクト: git786hub/DLL
        private void ExitCommand()
        {
            try
            {
                if (m_oGTTransactionManager.TransactionInProgress)
                {
                    m_oGTTransactionManager.Commit();
                    m_oGTTransactionManager.RefreshDatabaseChanges();
                }

                m_ooddcKeyObjects.Clear();

                m_oGTApp.Application.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "");

                UnsubscribeEvents();

                if (m_oGTCustomCommandHelper != null)
                {
                    m_oGTCustomCommandHelper.Complete();
                    m_oGTCustomCommandHelper = null;
                }

                m_oGTApp.Application.EndWaitCursor();
                m_oGTApp.Application.RefreshWindows();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                m_oGTApp = null;
                m_oGTCustomCommandHelper = null;
                m_ooddcKeyObjects        = null;
                m_oGTTransactionManager  = null;
                m_ofeature         = null;
                m_oOwnedFeatures   = null;
                m_ocommonComponent = null;
                m_oCUComponent     = null;
            }
        }
コード例 #19
0
 /// <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;
         }
     }
 }
コード例 #20
0
 /// <summary>
 /// Dispose all method before command exit
 /// </summary>
 private void CleanUp()
 {
     gtCustomCommandHelper.MouseMove -= gtCustomCommandHelper_MouseMove;
     if (detectOverlappingAnalysis != null)
     {
         detectOverlappingAnalysis.Dispose();
     }
     detectOverlappingAnalysis = null;
     if (gtTransactionManager != null)
     {
         if (gtTransactionManager.TransactionInProgress)
         {
             gtTransactionManager.Rollback();
         }
     }
     gtTransactionManager = null;
     if (gtCustomCommandHelper != null)
     {
         gtCustomCommandHelper.Complete();
     }
     gtCustomCommandHelper = null;
 }
コード例 #21
0
ファイル: gGlobals.cs プロジェクト: git786hub/DLL
 static internal void ExitCommand()
 {
     try
     {
         m_oGTApp.Application.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "");
         m_oGTApp.Application.EndWaitCursor();
         if (m_oGTCustomCommandHelper != null)
         {
             m_oGTCustomCommandHelper.Complete();
             m_oGTCustomCommandHelper = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error in Review Vouchers command: " + ex.Message, "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     finally
     {
         m_oGTCustomCommandHelper = null;
         m_oGTTransactionManager  = null;
     }
 }
コード例 #22
0
        /// <summary>
        /// To Exit the command.
        /// </summary>
        /// <param name="m_oGTTransactionManager"></param>
        /// <param name="m_GTCustomCommandHelper"></param>
        internal void ExitCommand(IGTTransactionManager m_oGTTransactionManager, IGTCustomCommandHelper m_GTCustomCommandHelper)
        {
            try
            {
                if (m_GTCustomCommandHelper != null)
                {
                    m_GTCustomCommandHelper.Complete();
                    m_GTCustomCommandHelper = null;
                }

                m_Application.Application.RefreshWindows();
            }
            catch
            {
                if (m_GTCustomCommandHelper != null)
                {
                    m_GTCustomCommandHelper.Complete();
                    m_GTCustomCommandHelper = null;
                }

                m_GTCustomCommandHelper = null;
                m_Application.Application.RefreshWindows();
            }
        }
コード例 #23
0
        public void Activate()
        {
            string jobStatus         = string.Empty;
            bool   dummyCuCodeExists = false;

            oHelper = new Helper();
            oHelper.m_dataContext = m_dataContext;
            oIsolationScenario    = new IsolationScenario(m_dataContext);

            try
            {
                #region Perform validations
                if (CheckIfNonWrJob())
                {
                    MessageBox.Show("This command applies only to WR jobs.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                IGTDDCKeyObjects selectedObjects = GTClassFactory.Create <IGTDDCKeyObjects>();
                List <int>       fidList         = new List <int>();
                IGTDDCKeyObjects ddcKeyObjects   = m_iGtApplication.SelectedObjects.GetObjects();
                foreach (IGTDDCKeyObject ddcKeyObject in ddcKeyObjects)
                {
                    if (!fidList.Contains(ddcKeyObject.FID))
                    {
                        fidList.Add(ddcKeyObject.FID);
                        selectedObjects.Add(ddcKeyObject);
                    }
                }
                m_selectedObject = selectedObjects[0];
                oHelper.m_fid    = m_selectedObject.FID;
                oHelper.m_fno    = m_selectedObject.FNO;
                if (!CheckIfFeatureIsReplaceable())
                {
                    MessageBox.Show("Replace Feature is not configured to operate on the selected feature class.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (!CheckIfValidCuAttributesExists(out dummyCuCodeExists))
                {
                    MessageBox.Show("This command applies only to features with CUs.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (dummyCuCodeExists)
                {
                    MessageBox.Show("This command cannot operate on dummy CUs (i.e.- CU codes beginning with ZZ).", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (!ValidateFeatureState())
                {
                    MessageBox.Show("One or more features are in an invalid feature state for this operation.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (!GetOffsetValuesFromGeneralParameters())
                {
                    MessageBox.Show("General parameters JobMgmt_ReplaceOffsetX or JobMgmt_ReplaceOffsetY  is not configured correctly.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (!CheckIfPointFeature())
                {
                    MessageBox.Show("Command is restricted to only work for point features.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (!CheckIfInstallAndActiveWrAreDifferent())
                {
                    MessageBox.Show("The same feature may not be installed and replaced in the same WR.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                #endregion

                frmSelectReplacementStatus oReplacementStatusForm = new frmSelectReplacementStatus();
                if (oReplacementStatusForm.ShowDialog(m_iGtApplication.ApplicationWindow) == DialogResult.Cancel)
                {
                    return;
                }
                else
                {
                    this.m_replaceAction = oReplacementStatusForm.ReplacementStatus;
                    m_iGtApplication.BeginWaitCursor();
                    m_oIsolationScenario = oIsolationScenario.CheckIsoScenarioFeature(m_selectedObject.FNO, m_selectedObject.FID);
                    ProcessReplacement();
                    m_TransactionManager.RefreshDatabaseChanges();
                }
            }
            catch (Exception ex)
            {
                m_iGtApplication.EndWaitCursor();
                m_TransactionManager.Rollback();

                MessageBox.Show("Error during execution of Replace Feature custom command." + Environment.NewLine + "Replace failed for selected feature." + Environment.NewLine + ex.Message, "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                m_TransactionManager = null;
                m_iGtApplication.EndWaitCursor();
            }
        }
コード例 #24
0
ファイル: ccAbandonFeature.cs プロジェクト: git786hub/DLL
        public void Activate()
        {
            string featureState = string.Empty;
            string jobStatus    = string.Empty;

            try
            {
                IGTDDCKeyObjects selectedObjects = GTClassFactory.Create <IGTDDCKeyObjects>();
                List <int>       fidList         = new List <int>();
                IGTDDCKeyObjects ddcKeyObjects   = m_iGtApplication.SelectedObjects.GetObjects();
                foreach (IGTDDCKeyObject ddcKeyObject in ddcKeyObjects)
                {
                    if (!fidList.Contains(ddcKeyObject.FID))
                    {
                        fidList.Add(ddcKeyObject.FID);
                        selectedObjects.Add(ddcKeyObject);
                    }
                }
                foreach (IGTDDCKeyObject selectedObject in selectedObjects)
                {
                    if (!ValidateFeatureState(selectedObject))
                    {
                        if (!m_AssetHistoryCheckpassed)
                        {
                            MessageBox.Show("This command cannot be used on unposted features.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                            return;
                        }

                        MessageBox.Show("One or more features are in an invalid feature state for this operation.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    if (!CheckIfCuAttributesExists(selectedObject))
                    {
                        MessageBox.Show("This command applies only to features with CUs.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    if (!CheckIfInstallAndActiveWrAreDifferent(selectedObject))
                    {
                        MessageBox.Show("The same feature may not be installed and abandoned in the same WR.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }

                if (CheckIfNonWrJob(out jobStatus))
                {
                    MessageBox.Show("This command applies only to WR jobs.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }



                // Validations have been completed. Update feature state.
                if (!m_TransactionManager.TransactionInProgress)
                {
                    m_TransactionManager.Begin("updating feature state...");
                }

                int current    = 1;
                int totalCount = selectedObjects.Count;
                foreach (IGTDDCKeyObject selectedObject in selectedObjects)
                {
                    m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Transtioning " + current + " out of " + totalCount + " features.");
                    SetFeatureStateBasedOnJobStatus(selectedObject, jobStatus);
                    SetActivity(selectedObject);
                    current++;
                }
                m_TransactionManager.Commit();

                // Sync work point in a new transaction

                m_TransactionManager.Begin("WP Synchronization...");

                foreach (IGTDDCKeyObject selectedObject in selectedObjects)
                {
                    ProcessWPSync(selectedObject);
                }
                m_TransactionManager.Commit();
                m_TransactionManager.RefreshDatabaseChanges();

                m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Selected features were transitioned successfully.");
            }
            catch (Exception ex)
            {
                m_TransactionManager.Rollback();
                MessageBox.Show("Error during execution of Abandon Feature custom command." + Environment.NewLine + "Transition failed for selected features." + Environment.NewLine + ex.Message, "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                m_TransactionManager = null;
            }
        }
コード例 #25
0
 public ProcessStreetLight(IGTApplication gTApplication, IGTTransactionManager gTTransactionManager)
 {
     m_gTApplication         = gTApplication;
     m_gTDataContext         = gTApplication.DataContext;
     m_oGTTransactionManager = gTTransactionManager;
 }
コード例 #26
0
 public NJUNSAutomationHelper(IGTTransactionManager TransactionManager)
 {
     transactionManager = TransactionManager;
     gtDataContext      = gtApp.DataContext;
 }
コード例 #27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="p_dataContext">The current G/Technology application object.</param>
 /// <param name="p_transactionManager">The transaction of G/Technology application.</param>
 public StreetLightRemoveProcessing(IGTDataContext p_dataContext, IGTTransactionManager p_transactionManager)
 {
     m_oGTDataContext        = p_dataContext;
     m_oGTTransactionManager = p_transactionManager;
 }
コード例 #28
0
ファイル: Form1.cs プロジェクト: git786hub/DLL
 public Form1(IGTTransactionManager transactionManager)
 {
     InitializeComponent();
     processing = new GISAuto_ServiceLine(transactionManager);
 }
コード例 #29
0
 public void Terminate()
 {
     gtTransactionManager = null;
 }
コード例 #30
0
        public void Activate(IGTCustomCommandHelper CustomCommandHelper)
        {
            m_gTCustomCommandHelper = CustomCommandHelper;
            if (GTDataContext.IsRoleGranted("PRIV_DESIGN_ALL"))
            {
                try
                {
                    presenter = new SupplementalAgreementPresenter(this, CustomCommandHelper, m_oGTTransactionManager);
                    //CustomCommandHelper.MouseMove += CustomCommandHelper_MouseMove;
                    string[] strAlterDesign;

                    if (presenter.IsCCommandValid())
                    {
                        //If command is valid and MSLA date exist CC loads MSLA form.
                        if (presenter.IsMSLAForm)
                        {
                            #region Form With MSLA

                            FormWithMSLA formWithMSLA = new FormWithMSLA();
                            formWithMSLA.StartPosition = FormStartPosition.CenterParent;


                            if (presenter.ActiveWR.Contains("-"))
                            {
                                strAlterDesign     = new string[2];
                                strAlterDesign     = presenter.ActiveWR.Split('-');
                                presenter.ActiveWR = strAlterDesign[0];
                            }
                            presenter.m_UserForm         = formWithMSLA;
                            formWithMSLA.m_formPresenter = presenter;
                            formWithMSLA.ShowDialog(m_iGtApplication.ApplicationWindow);

                            #endregion
                        }
                        else
                        {
                            //If command is valid and MSLA date is null CC loads with out MSLA form.

                            #region Form Without MSLA

                            FormWithoutMSLA formWithoutMSLA = new FormWithoutMSLA();
                            formWithoutMSLA.StartPosition = FormStartPosition.CenterParent;


                            if (presenter.ActiveWR.Contains("-"))
                            {
                                strAlterDesign     = new string[2];
                                strAlterDesign     = presenter.ActiveWR.Split('-');
                                presenter.ActiveWR = strAlterDesign[0];
                            }
                            presenter.m_UserForm            = formWithoutMSLA;
                            formWithoutMSLA.m_formPresenter = presenter;
                            formWithoutMSLA.ShowDialog(m_iGtApplication.ApplicationWindow);

                            #endregion
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(presenter.NotifyPresenterMess))
                        {
                            //GTClassFactory.Create<IGTApplication>().SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, presenter.NotifyPresenterMess);
                            MessageBox.Show(presenter.NotifyPresenterMess, "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Information,
                                            MessageBoxDefaultButton.Button1);


                            presenter = null;
                            //m_gTCustomCommandHelper.MouseMove -= CustomCommandHelper_MouseMove;
                            ExitCommand(m_gTCustomCommandHelper);
                        }
                        else
                        {
                            presenter = null;
                            // m_gTCustomCommandHelper.MouseMove -= CustomCommandHelper_MouseMove;
                            ExitCommand(m_gTCustomCommandHelper);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Error,
                                    MessageBoxDefaultButton.Button1);

                    //CustomCommandHelper.MouseMove -= CustomCommandHelper_MouseMove;

                    if (m_oGTTransactionManager != null)
                    {
                        if (m_oGTTransactionManager.TransactionInProgress)
                        {
                            m_oGTTransactionManager.Rollback();
                        }
                    }
                    m_oGTTransactionManager = null;

                    ExitCommand(CustomCommandHelper);
                }
            }
            else
            {
                MessageBox.Show("User does not have PRIV_DESIGN_ALL role.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Information,
                                MessageBoxDefaultButton.Button1);
                //CustomCommandHelper.MouseMove -= CustomCommandHelper_MouseMove;
                ExitCommand(CustomCommandHelper);
            }
        }