예제 #1
0
        public ActionResult DataBaseJson(string connectionStringName = "SqlServerHelper")
        {
            IEnumerable <DataBase.Models.ViewModels.DataBaseView> list_database = null;
            string connectionString = ConnectionString.connectionString(connectionStringName);

            if (!string.IsNullOrWhiteSpace(connectionString))
            {
                list_database = CacheHelper.GetCache(connectionString) as IEnumerable <DataBase.Models.ViewModels.DataBaseView>;
                if (list_database == null || list_database.Count() <= 0)
                {
                    list_database = homeDA.GetDatabase(connectionStringName);
                    CacheHelper.SetCache(connectionString, list_database, TimeSpan.FromHours(2));
                }
            }
            return(Json(list_database, "text/plain", JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ActionResult SiderDatabase(string connectionStringName = "SqlServerHelper")
        {
            IEnumerable <DataBase.Models.ViewModels.DataBaseView> list_database = null;
            string connectionString = ConnectionString.connectionString(connectionStringName);

            if (!string.IsNullOrWhiteSpace(connectionString))
            {
                list_database = CacheHelper.GetCache(connectionString) as IEnumerable <DataBase.Models.ViewModels.DataBaseView>;
                if (list_database == null || list_database.Count() <= 0)
                {
                    list_database = homeDA.GetDatabase(connectionStringName);
                    CacheHelper.SetCache(connectionString, list_database, TimeSpan.FromHours(2));
                }
            }

            ViewBag.conn = connectionStringName;
            return(PartialView(list_database));
        }