Ejemplo n.º 1
0
 public ActionResult CreateCacheItem(CacheMaterial theData)
 {
     if (theData.Id.IsNullOrEmpty())
     {
         return(Error("对象无效"));
     }
     else
     {
         _systemCache.SetCache(theData.Id, theData.Entity, new TimeSpan(0, 1, 0));
     }
     return(Success());
 }
        public ActionResult RemoveRowToCached(string mrId, string itemId)
        {
            //读取缓存的数据
            List <string> ids = _systemCache.GetCache(mrId) as List <String>;

            if (ids == null)
            {
                ids = new List <string>();
            }
            ids.Add(itemId);
            _systemCache.SetCache(mrId, ids, new TimeSpan(1, 1, 0));
            return(Success("成功!"));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 创建缓存项目(用于创建工程料单模板时使用)
 /// </summary>
 /// <param name="theData"></param>
 /// <returns></returns>
 public ActionResult CreateCacheItem(Pro_TemplateItem theData)
 {
     theData.Id = "12345";
     if (theData.Id.IsNullOrEmpty())
     {
         return(Error("新建项Id不为空"));
     }
     else
     {
         _systemCache.SetCache(theData.Id, theData, new TimeSpan(0, 1, 0));
     }
     return(Success());
 }