Beispiel #1
0
        private static Hashtable GetModuleUrl()
        {
            Hashtable hashtable = new Hashtable();
            string    str       = string.Empty;

            foreach (Component component in ComponentUtils.GetComponents())
            {
                string str2 = AppRuntime.AppRootPath + "\\bin\\" + component.ComId + ".dll";
                bool   flag = File.Exists(str2);
                if (flag)
                {
                    DllComponent dllComponent = new DllComponent(str2);
                    bool         flag2        = dllComponent.Instance != null;
                    if (flag2)
                    {
                        foreach (Module module in dllComponent.Instance.Modules)
                        {
                            bool flag3 = !hashtable.ContainsKey(module.MdId) && !string.IsNullOrEmpty(module.Url);
                            if (flag3)
                            {
                                hashtable.Add(module.MdId, "~/WIDGET/" + component.ComId + "/" + module.Url);
                            }
                        }
                    }
                }
            }
            return(hashtable);
        }
Beispiel #2
0
        public DllComponent(string componentFullFileName)
        {
            Assembly assembly = Assembly.LoadFrom(componentFullFileName);
            string   str      = "TIM." + Path.GetFileNameWithoutExtension(componentFullFileName) + ".DllComponent";
            bool     flag     = !(assembly.GetType(str) != null);

            if (!flag)
            {
                this.m_instance = (DllComponent)assembly.CreateInstance(str);
            }
        }
Beispiel #3
0
 public static void LosedInit()
 {
     FileInfo[] files = new DirectoryInfo(AppRuntime.AppRootPath + "\\bin").GetFiles("T_*.dll");
     for (int i = 0; i < files.Length; i++)
     {
         FileSystemInfo fileSystemInfo = files[i];
         TIM.T_KERNEL.DbTableCache.DllComponent instance = new TIM.T_KERNEL.DbTableCache.DllComponent(fileSystemInfo.FullName).Instance;
         bool flag = instance != null && !string.IsNullOrWhiteSpace(instance.ComId) && !string.IsNullOrWhiteSpace(instance.ComName);
         if (flag)
         {
             DataModuleUtils.Init(instance);
         }
     }
 }
Beispiel #4
0
 public static void Init(TIM.T_KERNEL.DbTableCache.DllComponent component)
 {
     foreach (DllModule dllModule in component.Modules)
     {
         bool flag = dllModule.Type == ModuleType.D && dllModule.CallObjectType != null;
         if (flag)
         {
             IDataModule dataModule = (IDataModule)Activator.CreateInstance(dllModule.CallObjectType);
             bool        flag2      = !DataModuleUtils.m_dicMdId_DataModule.ContainsKey(dllModule.MdId);
             if (flag2)
             {
                 DataModuleUtils.m_dicMdId_DataModule.TryAdd(dllModule.MdId, dataModule);
             }
             bool flag3 = !DataModuleUtils.m_dicMdName_DataModule.ContainsKey(dllModule.MdName);
             if (flag3)
             {
                 DataModuleUtils.m_dicMdName_DataModule.TryAdd(dllModule.MdName, dataModule);
             }
         }
     }
 }
Beispiel #5
0
        public static void Init(TIM.T_KERNEL.DbTableCache.DllComponent dllComponent)
        {
            List <DllModule> modules  = dllComponent.Modules;
            Database         database = LogicContext.GetDatabase();
            HSQL             hsql     = new HSQL(database);

            hsql.Clear();
            hsql.Add("delete from MODULE WHERE MODULE_COMID = :MODULE_COMID");
            hsql.ParamByName("MODULE_COMID").Value = dllComponent.ComId;
            database.ExecSQL(hsql);
            foreach (DllModule dllModule in modules)
            {
                bool flag = dllModule.Type == ModuleType.W || dllModule.Type == ModuleType.N;
                if (flag)
                {
                    hsql.Clear();
                    hsql.Add("SELECT MEPAGE_MDID FROM MEPAGE WHERE MEPAGE_MDID = :MEPAGE_MDID");
                    hsql.ParamByName("MEPAGE_MDID").Value = dllModule.MdId;
                    bool flag2 = DbHelper.ExistingRecord(hsql);
                    if (flag2)
                    {
                        hsql.Clear();
                        hsql.Add("UPDATE MEPAGE SET ");
                        hsql.Add("  MEPAGE_WFBID = :MEPAGE_WFBID,");
                        hsql.Add("  MEPAGE_COMID = :MEPAGE_COMID,");
                        hsql.Add("  MEPAGE_URL = :MEPAGE_URL,");
                        hsql.Add("  MEPAGE_TYPE = :MEPAGE_TYPE");
                        hsql.Add("WHERE MEPAGE_MDID = :MEPAGE_MDID");
                        hsql.ParamByName("MEPAGE_MDID").Value  = dllModule.MdId;
                        hsql.ParamByName("MEPAGE_WFBID").Value = dllModule.WfbId;
                        hsql.ParamByName("MEPAGE_COMID").Value = dllComponent.ComId;
                        hsql.ParamByName("MEPAGE_URL").Value   = dllModule.Url;
                        hsql.ParamByName("MEPAGE_TYPE").Value  = dllModule.Type.ToString();
                        database.ExecSQL(hsql);
                    }
                    else
                    {
                        hsql.Clear();
                        hsql.Add("INSERT INTO MEPAGE(MEPAGE_MDID,MEPAGE_WFBID,MEPAGE_COMID,MEPAGE_URL,MEPAGE_TYPE)");
                        hsql.Add("VALUES");
                        hsql.Add("(:MEPAGE_MDID,:MEPAGE_WFBID,:MEPAGE_COMID,:MEPAGE_URL,:MEPAGE_TYPE)");
                        hsql.ParamByName("MEPAGE_MDID").Value  = dllModule.MdId;
                        hsql.ParamByName("MEPAGE_WFBID").Value = dllModule.WfbId;
                        hsql.ParamByName("MEPAGE_COMID").Value = dllComponent.ComId;
                        hsql.ParamByName("MEPAGE_URL").Value   = dllModule.Url;
                        hsql.ParamByName("MEPAGE_TYPE").Value  = dllModule.Type.ToString();
                        database.ExecSQL(hsql);
                    }
                }
                else
                {
                    hsql.Clear();
                    hsql.Add("SELECT MODULE_MDID FROM MODULE WHERE MODULE_MDID = :MODULE_MDID");
                    hsql.ParamByName("MODULE_MDID").Value = dllModule.MdId;
                    bool flag3 = DbHelper.ExistingRecord(hsql);
                    if (flag3)
                    {
                        hsql.Clear();
                        hsql.Add("UPDATE MODULE SET ");
                        hsql.Add("  MODULE_COMID = :MODULE_COMID,");
                        hsql.Add("  MODULE_MDNAME = :MODULE_MDNAME,");
                        hsql.Add("  MODULE_TYPE = :MODULE_TYPE,");
                        hsql.Add("  MODULE_URL = :MODULE_URL,");
                        hsql.Add("  MODULE_ATTRIBUTE = :MODULE_ATTRIBUTE");
                        hsql.Add("WHERE MODULE_MDID = :MODULE_MDID");
                        hsql.ParamByName("MODULE_MDID").Value      = dllModule.MdId;
                        hsql.ParamByName("MODULE_COMID").Value     = dllComponent.ComId;
                        hsql.ParamByName("MODULE_MDNAME").Value    = dllModule.MdName;
                        hsql.ParamByName("MODULE_TYPE").Value      = dllModule.Type.ToString();
                        hsql.ParamByName("MODULE_URL").Value       = "";
                        hsql.ParamByName("MODULE_ATTRIBUTE").Value = dllModule.Attribute;
                        database.ExecSQL(hsql);
                    }
                    else
                    {
                        hsql.Clear();
                        hsql.Add("INSERT INTO MODULE(MODULE_MDID,MODULE_COMID,MODULE_MDNAME,MODULE_TYPE,MODULE_STDMDID,MODULE_URL,MODULE_ATTRIBUTE)");
                        hsql.Add("VALUES");
                        hsql.Add("(:MODULE_MDID,:MODULE_COMID,:MODULE_MDNAME,:MODULE_TYPE,:MODULE_STDMDID,:MODULE_URL,:MODULE_ATTRIBUTE)");
                        hsql.ParamByName("MODULE_MDID").Value      = dllModule.MdId;
                        hsql.ParamByName("MODULE_COMID").Value     = dllComponent.ComId;
                        hsql.ParamByName("MODULE_MDNAME").Value    = dllModule.MdName;
                        hsql.ParamByName("MODULE_TYPE").Value      = dllModule.Type.ToString();
                        hsql.ParamByName("MODULE_STDMDID").Value   = 0;
                        hsql.ParamByName("MODULE_URL").Value       = "";
                        hsql.ParamByName("MODULE_ATTRIBUTE").Value = dllModule.Attribute;
                        database.ExecSQL(hsql);
                    }
                }
            }
        }
Beispiel #6
0
        public static void Init()
        {
            FileInfo[] files = new DirectoryInfo(AppRuntime.AppRootPath + "\\bin").GetFiles("T_*.dll");
            int        i     = 0;

            while (i < files.Length)
            {
                FileInfo fileInfo = files[i];
                TIM.T_KERNEL.DbTableCache.DllComponent dllComponent = null;
                try
                {
                    dllComponent = new TIM.T_KERNEL.DbTableCache.DllComponent(fileInfo.FullName).Instance;
                    bool flag = dllComponent != null && !string.IsNullOrWhiteSpace(dllComponent.ComId) && !string.IsNullOrWhiteSpace(dllComponent.ComName);
                    if (!flag)
                    {
                        goto IL_289;
                    }
                    Database database = LogicContext.GetDatabase();
                    HSQL     hsql     = new HSQL(database);
                    hsql.Add("SELECT COMPONENT_COMID FROM COMPONENT WHERE COMPONENT_COMID = :COMPONENT_COMID");
                    hsql.ParamByName("COMPONENT_COMID").Value = dllComponent.ComId;
                    bool flag2 = DbHelper.ExistingRecord(hsql);
                    if (flag2)
                    {
                        hsql.Clear();
                        hsql.Add("UPDATE COMPONENT SET");
                        hsql.Add("  COMPONENT_COMNAME = :COMPONENT_COMNAME,");
                        hsql.Add("  COMPONENT_MDIDSTART = :COMPONENT_MDIDSTART,");
                        hsql.Add("  COMPONENT_MDIDEND = :COMPONENT_MDIDEND,");
                        hsql.Add("  COMPONENT_DISABLED = :COMPONENT_DISABLED");
                        hsql.Add("WHERE COMPONENT_COMID = :COMPONENT_COMID");
                        hsql.ParamByName("COMPONENT_COMID").Value     = dllComponent.ComId;
                        hsql.ParamByName("COMPONENT_COMNAME").Value   = dllComponent.ComName;
                        hsql.ParamByName("COMPONENT_MDIDSTART").Value = dllComponent.MdIdStart;
                        hsql.ParamByName("COMPONENT_MDIDEND").Value   = dllComponent.MdIdEnd;
                        hsql.ParamByName("COMPONENT_DISABLED").Value  = "N";
                        database.ExecSQL(hsql);
                    }
                    else
                    {
                        hsql.Clear();
                        hsql.Add("INSERT INTO COMPONENT(COMPONENT_COMID,COMPONENT_COMNAME,COMPONENT_MDIDSTART,COMPONENT_MDIDEND,COMPONENT_DISABLED)");
                        hsql.Add("VALUES");
                        hsql.Add("(:COMPONENT_COMID,:COMPONENT_COMNAME,:COMPONENT_MDIDSTART,:COMPONENT_MDIDEND,:COMPONENT_DISABLED)");
                        hsql.ParamByName("COMPONENT_COMID").Value     = dllComponent.ComId;
                        hsql.ParamByName("COMPONENT_COMNAME").Value   = dllComponent.ComName;
                        hsql.ParamByName("COMPONENT_MDIDSTART").Value = dllComponent.MdIdStart;
                        hsql.ParamByName("COMPONENT_MDIDEND").Value   = dllComponent.MdIdEnd;
                        hsql.ParamByName("COMPONENT_DISABLED").Value  = "N";
                        database.ExecSQL(hsql);
                    }
                }
                catch (Exception ex)
                {
                    AppEventLog.Error("ComponentInit 异常" + ex.Message);
                }
                goto IL_27A;
IL_289:
                i++;
                continue;
IL_27A:
                ModuleInit.Init(dllComponent);
                DataModuleUtils.Init(dllComponent);
                goto IL_289;
            }
        }