Ejemplo n.º 1
0
        public override void Run()
        {
            omsSessionContext    = WorkItem.Services.AddNew <OMSSessionContext, IOMSSessionContext>();
            omsWebServiceWrapper = WorkItem.Services.AddNew <AOMWebServiceWrapper, IAOMWebServiceWrapper>();

            OpenTabs      = new List <IDialogView>();
            configSection = ConfigurationManager.GetSection(OMSConfigurationSection.SectionKey) as OMSConfigurationSection;
            OMSProgramUtils.SetHostPort(configSection, UserSessionService);
            OMSProgramUtils.addIE10RegistryKey();

            ShellInteractionService.SmartPartClosing  += SmartPartClosingEventHandler;
            Application.Current.MainWindow.Closing    += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
            ShellInteractionService.HyperlinkExecuted += HyperlinkExecutedEventHandler;
            ShellInteractionService.HelpRequested     += HelpRequestedEventHandler;
        }
        public IList <string> GetUsers()
        {
            GetUsersUser            user   = new GetUsersUser();
            OMSConfigurationSection config = ConfigurationManager.GetSection("imi.supplychain.ux.modules.ordermanagement") as OMSConfigurationSection;

            if (config.SendDomainUserId)
            {
                user.LoginId = UserSessionService.DomainUser;
            }
            else
            {
                user.LoginId = UserSessionService.UserId;
            }

            Imi.SupplyChain.Services.OrderManagement.Users.DataContracts.Response[] responseItems =
                GetUsersService.GetUsers(new GetUsersUser[] { user }, config.SendDomainUserId);
            IList <string> userList = TransformUsers(responseItems);

            return(userList);
        }
        public XmlDocument GetMenu()
        {
            GetMenuUSER             user   = new GetMenuUSER();
            OMSConfigurationSection config = ConfigurationManager.GetSection("imi.supplychain.ux.modules.ordermanagement") as OMSConfigurationSection;

            if (config.SendDomainUserId)
            {
                user.LoginId = UserSessionService.DomainUser;
            }
            else
            {
                user.LoginId = UserSessionService.UserId;
            }
            user.Language = omsSessionContext.OMSLanguageCode;
            Imi.SupplyChain.Services.OrderManagement.Menu.DataContracts.Response[] orderMenu =
                GetMenuService.GetMenu(new GetMenuUSER[] { user }, config.SendDomainUserId);
            XmlDocument menu = TransformOrderMenuXml(orderMenu);

            //Debug.WriteLine(menu.OuterXml);
            return(menu);
        }
Ejemplo n.º 4
0
        internal static void SetHostPort(OMSConfigurationSection configSection, IUserSessionService UserSessionService)
        {
            string langCode    = UserSessionService.UICulture.ThreeLetterISOLanguageName;
            string aomPort     = null;
            string defaultPort = null;

            AomHostPortCollection languages = configSection.AomHostPortElementCollection;

            foreach (ConfigurationElement configElement in languages)
            {
                HostPortElement hostPortElement = configElement as HostPortElement;
                if (hostPortElement.Language.Equals(langCode))
                {
                    aomPort = hostPortElement.Number;
                    break;
                }
                else if (hostPortElement.Language.Equals("default"))
                {
                    defaultPort = hostPortElement.Number;
                }
            }

            if (aomPort == null)
            {
                aomPort = defaultPort;
            }

            try
            {
                configSection.HostPort = int.Parse(aomPort);
            }
            catch (System.Exception e)
            {
                System.Windows.MessageBox.Show("Error in format of AOM hostPort configuration from backend server, contact system administrator (" + aomPort + ")");
                throw e;
            }
        }
        public void GetGuiConfiguration()
        {
            GetGuiconfigurationUSER user = new GetGuiconfigurationUSER();

            user.UserId  = omsSessionContext.OMSLogicalUserId;
            user.LoginId = omsSessionContext.OMSLoginUserId;
            OMSConfigurationSection config = ConfigurationManager.GetSection("imi.supplychain.ux.modules.ordermanagement") as OMSConfigurationSection;

            user.PortNumber = config.HostPort;
            Imi.SupplyChain.Services.OrderManagement.Guiconfiguration.DataContracts.Response[] responseItems =
                GetGuiconfigurationService.GetGuiconfiguration(new GetGuiconfigurationUSER[] { user }, config.SendDomainUserId);

            if (responseItems.Count() > 0)
            {
                Imi.SupplyChain.Services.OrderManagement.Guiconfiguration.DataContracts.Response userConfig = responseItems[0];
                if (userConfig.Success)
                {
                    omsSessionContext.AutoStart            = userConfig.auto_start;
                    omsSessionContext.ClientProgram        = userConfig.clientprogram;
                    omsSessionContext.EnvironmentVariables = userConfig.env_vars;
                    omsSessionContext.Host                   = userConfig.host;
                    omsSessionContext.OMSLanguageCode        = userConfig.language;
                    omsSessionContext.Parameters             = userConfig.parameters;
                    omsSessionContext.Port                   = userConfig.port;
                    omsSessionContext.ServerProgram          = userConfig.program;
                    omsSessionContext.ServerWorkingDirectory = userConfig.working_directory;
                    omsSessionContext.SystemName             = userConfig.systemname;
                    omsSessionContext.HelpUrl                = userConfig.help_url;
                    omsSessionContext.DecimalKey             = userConfig.decimal_key;
                }
                else
                {
                    throw new Exception(userConfig.ErrorText);
                }
            }
        }
Ejemplo n.º 6
0
 public WebView()
 {
     InitializeComponent();
     configSection = ConfigurationManager.GetSection("imi.supplychain.ux.modules.ordermanagement") as OMSConfigurationSection;
 }