Пример #1
0
        /// <summary>
        /// Method which is invoked by the AddIn framework when the control is created.
        /// </summary>
        /// <param name="inDesignMode">Flag which indicates if the control is being drawn on the Workspace Designer. (Use this flag to determine if code should perform any logic on the workspace record)</param>
        /// <param name="RecordContext">The current workspace record context.</param>
        /// <returns>The control which implements the IWorkspaceComponent2 interface.</returns>
        public IWorkspaceComponent2 CreateControl(bool inDesignMode, IRecordContext RecordContext)
        {
            if (!ConfigurationSetting.configVerbPerfect)
            {
                if (!ConfigurationSetting.loginUserIsAdmin)
                {
                    MessageBox.Show("RepairOrderAddIn is not initialized properly. \nPlease contact your system administrator.\n You are now logged out.");
                    _gContext.Logout();
                }
                else // don't want to logout admin
                {
                    MessageBox.Show("RepairOrderAddIn is not loaded because of invalid configuration verb.");
                    return(new RepairOrderAddIn(inDesignMode, RecordContext, isEnabledEditing));
                }
            }

            _rContext = RecordContext;
            string logMessage, logNote;

            if (!inDesignMode && _rContext != null)
            {
                // Set config according to custom configuration verb
                ConfigurationSetting instance = ConfigurationSetting.Instance(_gContext);

                _usr = ConfigurationSetting.username;
                _pwd = ConfigurationSetting.password;
                _log = ConfigurationSetting.logWrap;
                _ebsDefaultSrOwnerId        = ConfigurationSetting.ebsDefaultSrOwnerId;
                RepairOrder.ServiceProvider = ConfigurationSetting.EBSProvider;
                RepairOrder.CreateURL       = ConfigurationSetting.CreateRepair_WSDL;
                RepairOrder.UpdateURL       = ConfigurationSetting.UpdateRepair_WSDL;
                //RepairOrder.LookupURL = ConfigurationSetting.LookupRepair_WSDL;
                //RepairOrder.ListLookupURL = ConfigurationSetting.LookupRepairList_WSDL;
                RepairOrder.ListURL              = ConfigurationSetting.RepairOrderList_WSDL;
                RepairOrder.ServiceUsername      = _usr;
                RepairOrder.ServicePassword      = _pwd;
                RepairOrder.ServiceClientTimeout = ConfigurationSetting.EBSServiceTimeout;
                RepairOrder.InitEBSProvider();
                logMessage = "Repair Order is initiated.";
                logNote    = "";
                _log.DebugLog(logMessage: logMessage, logNote: logNote);
            }

            /*
             * bool isEnabled = false;
             * if (isEnabledEditing == "true")
             * {
             *  isEnabled = true;
             * }*/
            _wsAddIn      = new RepairOrderAddIn(inDesignMode, _rContext, isEnabledEditing);
            _wsAddIn._log = _log;
            _wsAddIn._ebsDefaultSrOwnerId = _ebsDefaultSrOwnerId;
            if (_log != null)
            {
                logMessage = "Repair Order AddIn is setup.";
                logNote    = "";
                _log.DebugLog(logMessage: logMessage, logNote: logNote);
            }
            return(_wsAddIn);
        }
Пример #2
0
        /// <summary>
        /// Method which is invoked by the AddIn framework when the control is created.
        /// </summary>
        /// <param name="inDesignMode">Flag which indicates if the control is being drawn on the Workspace Designer. (Use this flag to determine if code should perform any logic on the workspace record)</param>
        /// <param name="RecordContext">The current workspace record context.</param>
        /// <returns>The control which implements the IWorkspaceComponent2 interface.</returns>
        public IWorkspaceComponent2 CreateControl(bool inDesignMode, IRecordContext RecordContext)
        {
            if (!ConfigurationSetting.configVerbPerfect)
            {
                if (!ConfigurationSetting.loginUserIsAdmin)
                {
                    MessageBox.Show("Activity Add-In is not initialized properly. \nPlease contact your system administrator.\n You are now logged out.");
                    _gContext.Logout();
                }
                else // don't want to logout admin
                {
                    MessageBox.Show("Activity Add-In is not loaded because of invalid configuration verb.");
                    return(new ActivityAddIn(inDesignMode, RecordContext));
                }
            }

            _rContext = RecordContext;
            if (!inDesignMode && _rContext != null)
            {
                ConfigurationSetting instance = ConfigurationSetting.Instance(_gContext);

                _usr = ConfigurationSetting.username;
                _pwd = ConfigurationSetting.password;
                //_client = ConfigurationSetting.client;
                _rnSrv = ConfigurationSetting.rnSrv;
                _log   = ConfigurationSetting.logWrap;
                _siebelServiceUserId    = ConfigurationSetting.siebelServiceUserId;
                _siebelDefaultSrOwnerId = ConfigurationSetting.siebelDefaultSrOwnerId;

                Activity.ServiceProvider      = ConfigurationSetting.SiebelProvider;
                Activity.LookupURL            = ConfigurationSetting.CreateSR_WSDL;
                Activity.ServiceUsername      = String.IsNullOrEmpty(_usr) ? "ebusiness" : _usr;
                Activity.ServicePassword      = String.IsNullOrEmpty(_pwd) ? "password" : _pwd;
                Activity.ServiceClientTimeout = ConfigurationSetting.SiebelServiceTimeout;
                Activity.InitSiebelProvider();
            }
            _wsAddIn = new ActivityAddIn(inDesignMode, _rContext);

            _wsAddIn._rnSrv = _rnSrv;
            _wsAddIn._log   = _log;
            _wsAddIn._siebelServiceUserId = _siebelServiceUserId;


            if (_log != null)
            {
                string logMessage = "Activity AddIn is setup.";
                _log.DebugLog(logMessage: logMessage);
            }

            return(_wsAddIn);
        }
Пример #3
0
        /// <summary>
        /// Method which is invoked by the AddIn framework when the control is created.
        /// </summary>
        /// <param name="inDesignMode">Flag which indicates if the control is being drawn on the Workspace Designer. (Use this flag to determine if code should perform any logic on the workspace record)</param>
        /// <param name="RecordContext">The current workspace record context.</param>
        /// <returns>The control which implements the IWorkspaceComponent2 interface.</returns>
        public IWorkspaceComponent2 CreateControl(bool inDesignMode, IRecordContext RecordContext)
        {
            if (!ConfigurationSetting.configVerbPerfect)
            {
                if (!ConfigurationSetting.loginUserIsAdmin)
                {
                    System.Windows.Forms.MessageBox.Show("OrderManagementAddin is not initialized properly. \nPlease contact your system administrator.\n You are now logged out.");
                    _gContext.Logout();
                }
                else // don't want to logout admin
                {
                    System.Windows.Forms.MessageBox.Show("OrderManagementAddin is not loaded because of invalid configuration verb.");
                    return(new WorkspaceAddIn(inDesignMode, RecordContext, _gContext, _Version));
                }
            }

            return(new WorkspaceAddIn(inDesignMode, RecordContext, _gContext, _Version));
        }
Пример #4
0
        /// <summary>
        /// Method which is invoked by the AddIn framework when the control is created.
        /// </summary>
        /// <param name="inDesignMode">Flag which indicates if the control is being drawn on the Workspace Designer. (Use this flag to determine if code should perform any logic on the workspace record)</param>
        /// <param name="RecordContext">The current workspace record context.</param>
        /// <returns>The control which implements the IWorkspaceComponent2 interface.</returns>
        public IWorkspaceComponent2 CreateControl(bool inDesignMode, IRecordContext RecordContext)
        {
            if (!ConfigurationSetting.configVerbPerfect)
            {
                if (!ConfigurationSetting.loginUserIsAdmin)
                {
                    MessageBox.Show("Contact Search Add-In is not initialized properly. \nPlease contact your system administrator.\n You are now logged out.");
                    _globalContext.Logout();
                }
                else // don't want to logout admin
                {
                    MessageBox.Show("Contact Search Add-In is not loaded because of invalid configuration verb.");
                    return(new ContactWorkspaceAddIn(inDesignMode, RecordContext, _globalContext));
                }
            }
            _rContext = RecordContext;
            if (!inDesignMode && RecordContext != null)
            {
                //Get configuration
                ConfigurationSetting instance = ConfigurationSetting.Instance(_globalContext);
                _usr    = ConfigurationSetting.username;
                _pwd    = ConfigurationSetting.password;
                _client = ConfigurationSetting.client;
                _rnSrv  = ConfigurationSetting.rnSrv;
                _log    = ConfigurationSetting.logWrap;

                Accelerator.EBS.SharedServices.ContactModel.ServiceProvider      = ConfigurationSetting.EBSProvider;
                Accelerator.EBS.SharedServices.ContactModel.ListLookupURL        = ConfigurationSetting.LookupContactList_WSDL;
                Accelerator.EBS.SharedServices.ContactModel.ServiceUsername      = String.IsNullOrEmpty(_usr) ? "ebusiness" : _usr;
                Accelerator.EBS.SharedServices.ContactModel.ServicePassword      = String.IsNullOrEmpty(_pwd) ? "password" : _pwd;
                Accelerator.EBS.SharedServices.ContactModel.ServiceClientTimeout = ConfigurationSetting.EBSServiceTimeout;
                Accelerator.EBS.SharedServices.ContactModel.InitEBSProvider();

                Contact_Search_Report_ID = ConfigurationSetting.contactSearchReportID;
            }
            _wsAddIn = new ContactWorkspaceAddIn(inDesignMode, RecordContext, _globalContext);
            _wsAddIn._contactSearchReportId = Contact_Search_Report_ID;
            _wsAddIn._rnSrv = _rnSrv;
            _wsAddIn._log   = _log;
            return(_wsAddIn);
        }
Пример #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            // upd label if admin
            if (ConfigurationSetting.loginUserIsAdmin)
            {
                LogHistoryNSettingForm logForm = new LogHistoryNSettingForm();

                for (int i = ConfigurationSetting.logHistoryIndex - 1; i >= 0; i--)
                {
                    ListViewItem listViewItem = new ListViewItem();
                    listViewItem.Text = (string)ConfigurationSetting.logHistory.ToArray().ToList()[i];
                    logForm.logHistoryListView.Items.Add(listViewItem);
                }

                logForm.ShowDialog();
            }
            if (!ConfigurationSetting.configVerbPerfect && !ConfigurationSetting.loginUserIsAdmin)
            {
                String logMessage = "You will be logged out. Please contact your system administrator.";
                MessageBox.Show(logMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                _gContext.Logout();
            }
        }