Beispiel #1
0
        private static bool RegisterModule(NameSpace nameSpace)
        {
            var nspace = new NameSpace(nameSpace)
            {
                Application = "ModuleData.RegisterModule"
            };

            var registerTable = (RegisterModule)DllManager.CreateIstance(nspace, null);

            var bOk = true;

            if (registerTable != null)
            {
                if (ActivationManager.IsActivate(registerTable.Module()) != ActivationState.NotActivate)
                {
                    bOk = registerTable.CreateTable(GlobalInfo.DBaseInfo.dbManager.DB_Connection, GlobalInfo.UserInfo.userType);
                    if (bOk)
                    {
                        registerTable.RegisterCountersAndCodes();
                    }
                }
                else
                {
                    return(false);
                }
            }
            return(bOk);
        }
Beispiel #2
0
        public static object Create(NameSpace ns, object[] parameters = null)
        {
            object obj = DllManager.CreateIstance(ns, parameters);

            AttachAddOn(obj, ns);
            AttachPreferences(obj, ns);

            return(obj);
        }
Beispiel #3
0
 private static void AttachAddOn(object obj, NameSpace ns)
 {
     if (obj is ERPFramework.Forms.IDocument)
     {
         foreach (ApplicationMenuModule amm in ModuleManager.ModuleList)
         {
             string module = amm.Namespace.Module;
             amm.Namespace.Application = "ModuleData.RegisterModule";
             RegisterModule registerModule = (RegisterModule)DllManager.CreateIstance(amm.Namespace, null);
             if (registerModule != null)
             {
                 registerModule.Addon(obj as ERPFramework.Forms.IDocument, ns);
             }
         }
     }
 }
Beispiel #4
0
        private static void AttachPreferences(object obj, NameSpace nameSpace)
        {
            if (obj is ERPFramework.Preferences.PreferenceForm)
            {
                ERPFramework.Preferences.PreferenceForm form = obj as ERPFramework.Preferences.PreferenceForm;
                RegisterModule registerModule = (RegisterModule)DllManager.CreateIstance(new NameSpace("ERPManager.ERPManager.ModuleData.RegisterModule"), null);
                if (registerModule != null)
                {
                    form.AddPanel(registerModule.RegisterPreferences());
                }

                foreach (ApplicationMenuModule amm in ModuleManager.ModuleList)
                {
                    string module = amm.Namespace.Module;
                    amm.Namespace.Application = "ModuleData.RegisterModule";
                    registerModule            = (RegisterModule)DllManager.CreateIstance(amm.Namespace, null);
                    if (registerModule != null)
                    {
                        form.AddPanel(registerModule.RegisterPreferences());
                    }
                }
            }
        }