Ejemplo n.º 1
0
        /// <summary>
        /// 查询所有的系统资源
        /// </summary>
        /// <returns></returns>
        public JsonResult QueryAll()
        {
            this.systemResourcesService = new SystemResourcesService();

            var list = this.systemResourcesService.QueryAll();
            return list != null ? this.Json(list, JsonRequestBehavior.AllowGet) : this.Json(null,JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The refresh resource.
        /// </summary>
        public static void RefreshResource()
        {
            var mongoDbStore = new MongoDbStore<System_Resources>("Resources");
            mongoDbStore.Delete(item => item.ID != 0);

            var systemResourcesService = new SystemResourcesService();
            var resources = systemResourcesService.QueryAll();

            foreach (var resource in resources)
            {
                mongoDbStore.Insert(resource);
            }
        }