Esempio n. 1
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     ConfigureManager.Run();
     Ioc.UnityInject.UnityWebActivator.Start();
 }
Esempio n. 2
0
        public virtual bool Loading()
        {
            ConfigureManager cfg      = new ConfigureManager(this);
            bool             isChange = false;

            if (cfg.IsConfigKeyExists("Address"))
            {
                this.DatabaseAddr = cfg ["Address"];
            }
            else
            {
                cfg ["Address"] = "127.0.0.1";
                isChange        = true;
            }
            if (cfg.IsConfigKeyExists("Ports"))
            {
                this.DatabasePorts = cfg ["Ports"];
            }
            else
            {
                cfg ["Ports"] = "3306";
                isChange      = true;
            }
            if (cfg.IsConfigKeyExists("User"))
            {
                this.DatabaseUser = cfg ["User"];
            }
            else
            {
                cfg ["User"] = "******";
                isChange     = true;
            }
            if (cfg.IsConfigKeyExists("Password"))
            {
                this.DatabasePassword = cfg ["Password"];
            }
            else
            {
                cfg ["Password"] = "******";
                isChange         = true;
            }
            if (cfg.IsConfigKeyExists("Database"))
            {
                this.DefaultDatabse = cfg ["Database"];
            }
            else
            {
                cfg ["Database"] = "Default";
                isChange         = true;
            }
            if (isChange)
            {
                cfg.SaveAllConfig();
            }
            return(true);
        }
Esempio n. 3
0
        public static dynamic GetPermissionData(int entityID, int userID)
        {
            dynamic result = null;

            using (var conn = ConfigureManager.CreateConnection(strConn))
            {
                string strSQL = @"SELECT DataID FROM userentitydata 
                                    WHERE EntityID=@EntityID AND UserID=@UserID;";
                result = conn.Query <int>(strSQL, new { EntityID = entityID, UserID = userID }).ToList();
            }
            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// we should add all regex to the list
        /// from a config file
        /// </summary>
        public override bool Loading()
        {
            ConfigureManager cfg = new ConfigureManager(this);

            if (!cfg.IsConfigKeyExists("RegexFile"))
            {
                cfg ["RegexFile"] = "Regex.xml";
                cfg.SaveAllConfig();
            }
            this.RegexConfigFile = cfg.ConfigDirectory + "/" + cfg ["RegexFile"];
            this.LoadRules();
            return(base.Loading());
        }
Esempio n. 5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IDatabaseManager databaseManager)
        {
            ConfigureManager.ConfigureNLog(app, env, loggerFactory, _configuration);
            ConfigureManager.ConfigureLocalization(app);
            ConfigureManager.ConfigureEtc(app);

            if (env.IsDevelopment())
            {
                ConfigureManager.ConfigureDebugEnv(app);
            }
            else
            {
                ConfigureManager.ConfigureReleaseEnv(app);
            }

            ConfigureManager.ConfigureFolders(env);
            ConfigureManager.ConfigureRoutes(app);

            // Database configuration
            databaseManager.SeedRoles().Wait();
        }
Esempio n. 6
0
        public override bool Loading()
        {
            //the version field is the Plugin GUID
            this.date.VersionHash = this.GetGUID();
            ConfigureManager cfg = new ConfigureManager(this);
            int min = 100;
            int max = 200;

            if (cfg.IsConfigKeyExists("MinCount") && cfg.IsConfigKeyExists("MaxCount"))
            {
                min = Convert.ToInt32(cfg ["MinCount"]);
                max = Convert.ToInt32(cfg ["MaxCount"]);
            }
            else
            {
                cfg ["MinCount"] = 100.ToString ();
                cfg ["MaxCount"] = 200.ToString ();
                cfg.SaveAllConfig();
            }
            this.setOtherArgs(min, max);
            return(true);
        }
Esempio n. 7
0
 static BaseDAO()
 {
     ConfigureManager.Initialization(typeof(BaseDAO));
     logger = LogManager.GetCurrentClassLogger();
 }