Beispiel #1
0
        public override void ShowModule(IWin32Window owner)
        {
            // terminal last session
            try
            {
                var clientInfos = CachedUtils.GetCacheOf <ClientInfo>("LastSession");
                if (clientInfos.Count > 0)
                {
                    App.Environment.ClientInfo.SessionKey = clientInfos[0].SessionKey;
                    using (var ctrlSA = new SAController())
                    {
                        ctrlSA.TerminalCurrentSession();
                    }
                }
            }
            catch
            {
            }
            // login
            var frmOwner = (XtraForm)Parent;

            InitializeModuleData();

            App.Environment.ClientInfo.SessionKey = null;
            frmOwner.ShowDialog(owner);

            if (App.Environment.ClientInfo.SessionKey == null)
            {
                MainProcess.Close();
            }
        }
        public override List <SysvarInfo> BuildSysvarInfoCache()
        {
            var colSysvarInfo = CachedUtils.GetCacheOf <SysvarInfo>(ServerCachedHashInfo.SysvarInfoHash);

            if (colSysvarInfo == null)
            {
                using (var ctrlSA = new SAController())
                {
                    ctrlSA.ListSysvarInfo(out colSysvarInfo);
                }

                CachedUtils.SetCacheOf(colSysvarInfo, ServerCachedHashInfo.SysvarInfoHash);
            }
            return(colSysvarInfo);
        }
        public override List <ExportHeader> BuildExportHeaderCache()
        {
            var colExportHeaderInfo = CachedUtils.GetCacheOf <ExportHeader>(ServerCachedHashInfo.ExportHeaderInfoHash);

            if (colExportHeaderInfo == null)
            {
                using (var ctrlSA = new SAController())
                {
                    ctrlSA.ListExportHeaderInfo(out colExportHeaderInfo);
                }

                CachedUtils.SetCacheOf(colExportHeaderInfo, ServerCachedHashInfo.ExportHeaderInfoHash);
            }
            return(colExportHeaderInfo);
        }
        public override List <GroupSummaryInfo> BuildGroupSummaryCache()
        {
            var colGroupSummaryInfo = CachedUtils.GetCacheOf <GroupSummaryInfo>(ServerCachedHashInfo.GroupSummaryInfoHash);

            if (colGroupSummaryInfo == null)
            {
                using (var ctrlSA = new SAController())
                {
                    ctrlSA.ListGroupSummaryInfo(out colGroupSummaryInfo);
                }

                CachedUtils.SetCacheOf(colGroupSummaryInfo, ServerCachedHashInfo.GroupSummaryInfoHash);
            }
            return(colGroupSummaryInfo);
        }
        public override List <ButtonParamInfo> BuildSearchButtonParamsCache()
        {
            var colSearchButtonParamsInfo = CachedUtils.GetCacheOf <ButtonParamInfo>(ServerCachedHashInfo.SearchButtonParamsInfoHash);

            if (colSearchButtonParamsInfo == null)
            {
                using (var ctrlSA = new SAController())
                {
                    ctrlSA.ListSearchButtonParam(out colSearchButtonParamsInfo);
                }

                CachedUtils.SetCacheOf(colSearchButtonParamsInfo, ServerCachedHashInfo.SearchButtonParamsInfoHash);
            }
            return(colSearchButtonParamsInfo);
        }
        public override List <OracleParam> BuildOracleParamsCache()
        {
            var oracleParamsInfo = CachedUtils.GetCacheOf <OracleParam>(ServerCachedHashInfo.OracleParamsInfoHash);

            if (oracleParamsInfo == null)
            {
                using (var ctrlSA = new SAController())
                {
                    ctrlSA.ListOracleParameter(out oracleParamsInfo);
                }

                CachedUtils.SetCacheOf(oracleParamsInfo, ServerCachedHashInfo.OracleParamsInfoHash);
            }

            return(oracleParamsInfo);
        }
        public override List <LanguageInfo> BuildLanguageCache()
        {
            var instanceHash    = ClientInfo.LanguageID + "-" + ServerCachedHashInfo.LanguageHash;
            var colLanguageInfo = CachedUtils.GetCacheOf <LanguageInfo>(instanceHash);

            if (colLanguageInfo == null)
            {
                using (var ctrlSA = new SAController())
                {
                    ctrlSA.ListLanguage(out colLanguageInfo, ClientInfo.LanguageID);
                }

                CachedUtils.SetCacheOf(colLanguageInfo, instanceHash);
            }

            return(colLanguageInfo);
        }
        public override List <ModuleFieldInfo> BuildModuleFieldCache()
        {
            var modulesFieldsInfo = CachedUtils.GetCacheOf <ModuleFieldInfo>(ServerCachedHashInfo.ModuleFieldsInfoHash);

            if (modulesFieldsInfo == null)
            {
                using (var ctrlSA = new SAController())
                {
                    List <ModuleFieldInfo> tempModuleFields;
                    var startRow = 0;
                    modulesFieldsInfo = new List <ModuleFieldInfo>();
                    do
                    {
                        ctrlSA.ListModuleField(out tempModuleFields, out startRow, startRow);
                        modulesFieldsInfo.AddRange(tempModuleFields.ToArray());
                    }while (tempModuleFields.Count != 0);
                }
                CachedUtils.SetCacheOf(modulesFieldsInfo, ServerCachedHashInfo.ModuleFieldsInfoHash);
            }


            return(modulesFieldsInfo);
        }