示例#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;
            }
        }
        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
 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);
     }
 }
 /// <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
        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;
         }
     }
 }
 /// <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
        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;
 }
 /// <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);
 }
 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);
            }
        }