示例#1
0
        /// <summary>
        /// 修改三方数据源
        /// </summary>
        /// <returns></returns>
        public ActionResult DataSource()
        {
            var dict = GetParams();
            //(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.89)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ydtest)))
            var dataSource = string.Format("(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = {0})(PORT = {1}))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = {2})))",
                                           dict.GetString("Host"), dict.GetString("Port"), dict.GetString("SID"));
            var url = string.Format("Data Source={0};User ID={1};Password={2};", dataSource, dict.GetString("UserName"), dict.GetString("Password"));

            var p = new
            {
                Provider = dict.GetString("Provider"),
                Url      = url,
                UserName = dict.GetString("UserName"),
                Password = dict.GetString("Password"),
                Database = dataSource,
                ID       = "ef090fc0-a178-42a7-81da-5f6d5021bf81"
            };

            var result = DB.Execute(new DBState
            {
                Name  = "UPDATE_DataSource",
                Param = p.toStrObjDict(),
                Type  = ESqlType.UPDATE
            });

            if (result > 0)
            {
                WebAppContextInit.ThirdDbInit();
                ThirdServiceContext.Initializer(DeployMode.MODE_NORMAL);
            }
            return(this.MyJson(result));
        }
示例#2
0
        //public static void RegisterRoutes(RouteCollection routes)
        //{
        //    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        //    routes.MapRoute(
        //        "Default", // 路由名称
        //        "{controller}/{action}/{id}", // 带有参数的 URL
        //        new { controller = "Home", action = "Index", id = UrlParameter.Optional } // 参数默认值
        //    );

        //}

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            //RegisterRoutes(RouteTable.Routes);

            WebAppContextInit.LocalDbInit();
            WebAppContextInit.ThirdDbInit();
            WebAppContextInit.RoutesInit(RouteTable.Routes);
            WebAppContextInit.ViewInit();
            WebAppContextInit.OtherInit();
        }