Beispiel #1
0
        public void StartupModules()
        {
            if (App.Environment.ClientInfo.SessionKey != null)
            {
                ThemeUtils.ChangeSkin(App.Environment.ClientInfo.UserProfile.ApplicationSkinName);

                foreach (var module in AllCaches.ModulesInfo)
                {
                    if (module.StartMode == CODES.DEFMOD.STARTMODE.AUTOMATIC)
                    {
                        try
                        {
                            using (var ctrlSA = new SAController())
                            {
                                ctrlSA.CheckRole(module);
                                var startupModule = CreateModuleInstance(module.ModuleID, module.SubModule);
                                startupModule.ShowModule(m_mainForm);
                            }
                        }
                        catch (FaultException ex)
                        {
                            if (ex.Code.Name != ERR_SYSTEM.ERR_SYSTEM_MODULE_NOT_ALLOW_ACCESS.ToString())
                            {
                                frmInfo.ShowError(((IMain)m_mainForm).Language.ApplicationTitle, ex, m_mainForm);
                            }
                        }
                        catch (Exception ex)
                        {
                            frmInfo.ShowError(((IMain)m_mainForm).Language.ApplicationTitle, ErrorUtils.CreateErrorWithSubMessage(ERR_SYSTEM.ERR_SYSTEM_UNKNOWN, ex.Message), m_mainForm);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public override void Execute()
        {
            new WorkerThread(
                delegate
            {
                try
                {
                    LockUserAction();

                    using (var ctrlSA = new SAController())
                    {
                        List <string> values;
                        GetOracleParameterValues(out values, ExecProcInfo.ExecuteStore);
                        ctrlSA.ExecuteProcedure(ModuleInfo.ModuleID, ModuleInfo.SubModule, values);

                        // Hard-codes for special modules
                        switch (ModuleInfo.ModuleID)
                        {
                        case "0128":
                            App.Environment.GetCurrentUserProfile();
                            ThemeUtils.ChangeSkin(App.Environment.ClientInfo.UserProfile.ApplicationSkinName);
                            break;
                        }

                        RequireRefresh = true;
                    }
                }
                catch (Exception ex)
                {
                    ShowError(ex);
                }
                finally
                {
                    UnLockUserAction();
                    CloseModule();
                }
            },
                this).Start();
        }
Beispiel #3
0
        void barManagerSkins_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (LinkPersistInfo item in barSubItem2.LinksPersistInfo)
            {
                item.Item.Enabled = true;
            }
            BarSubItem subMenu = e.Item as BarSubItem;

            if (subMenu != null)
            {
                return;
            }
            {
                using (SAController ctrlSA = new SAController())
                {
                    List <string> values = new List <string>();
                    values.Add(e.Item.Caption.ToString());
                    ctrlSA.ExecuteChangeSkins(values);
                }
                e.Item.Enabled = false;
            }
            App.Environment.GetCurrentUserProfile();
            ThemeUtils.ChangeSkin(App.Environment.ClientInfo.UserProfile.ApplicationSkinName);
        }