/// <summary>
    /// 保存信息
    /// </summary>
    public void SaveInfo()
    {
        if (CacheKeyID.IsNull())
        {
            ///程序标识
            objcache_cachekey.CacheSiteID = CacheSiteID;
            ///路经
            objcache_cachekey.IDPath = "";
            ///依懒Key
            objcache_cachekey.CacheKey = txtCacheKey.TextCutWord(100);
            ///依懒名称
            objcache_cachekey.CacheName = txtCacheName.TextCutWord(100);
            ///备注
            objcache_cachekey.Remark = txtRemark.TextCutWord(500);
            objCacheRule.Insertcachekey(objcache_cachekey);
            MessageDialog("新增成功", "CacheKeyList.aspx?CacheSiteID=" + CacheSiteID);
        }
        else
        {
            objcache_cachekey = objCacheRule.cache_cachekey.FirstOrDefault(p => p.CacheKeyID == CacheKeyID);
            if (CheckEditObjectIsNull(objcache_cachekey))
            {
                return;
            }

            ///依懒Key
            objcache_cachekey.CacheKey = txtCacheKey.TextCutWord(100);
            ///依懒名称
            objcache_cachekey.CacheName = txtCacheName.TextCutWord(100);
            ///备注
            objcache_cachekey.Remark = txtRemark.TextCutWord(500);
            objCacheRule.Updatecachekey(objcache_cachekey);
            MessageDialog("修改成功", "CacheKeyList.aspx?CacheSiteID=" + CacheSiteID);
        }
    }
    /// <summary>
    /// 变量
    /// </summary>

    public override void RenderPage()
    {
        if (CacheKeyID.IsNoNull())
        {
            CacheKeyRule   objCacheRule      = new CacheKeyRule();
            cache_cachekey objcache_cachekey = objCacheRule.cache_cachekey.FirstOrDefault(s => s.CacheKeyID == CacheKeyID);
            txtKey.Text = objcache_cachekey.CacheKey;
        }
    }
    /// <summary>
    /// 页面加载
    /// </summary>
    public override void RenderPage()
    {
        if (CacheKeyID.IsNoNull())
        {
            objcache_cachekey = objCacheRule.cache_cachekey.FirstOrDefault(s => s.CacheKeyID == CacheKeyID);
            if (CheckEditObjectIsNull(objcache_cachekey))
            {
                return;
            }

            Page.DataBind();
        }
        else
        {
        }
    }
Exemple #4
0
 public void Updatecachekey(cache_cachekey objcache_cachekey)
 {
     objcache_cachekey.CacheName.CheckIsNull("请输入缓存名称", "ParameterLog");
     if (objcache_cachekey.CacheKey.IsNoNull())
     {
         if (this.cache_cachekey.Any((cache_cachekey s) => s.CacheKeyID != objcache_cachekey.CacheKeyID && s.CacheKey == objcache_cachekey.CacheKey))
         {
             SysAssert.ArgumentAssert <LogModuleType>("输入缓存Key已经存在", LogModuleType.ParameterLog);
         }
     }
     else if (objcache_cachekey.CacheKey.IsNull())
     {
         cache_cachesite cache_cachesite = this.cache_cachesite.FirstOrDefault((cache_cachesite s) => s.CacheSiteID == objcache_cachekey.CacheSiteID);
         objcache_cachekey.CacheKey = cache_cachesite.CachePrefix + "_" + objcache_cachekey.CacheKeyID;
         this.CurrentEntities.SaveChanges();
     }
     this.CurrentEntities.SaveChanges();
 }
Exemple #5
0
        public void Insertcachekey(cache_cachekey objcache_cachekey)
        {
            objcache_cachekey.CacheName.CheckIsNull("请输入缓存名称", "ParameterLog");
            if (objcache_cachekey.CacheKey.IsNoNull() && this.cache_cachekey.Any((cache_cachekey s) => s.CacheKey == objcache_cachekey.CacheKey))
            {
                SysAssert.ArgumentAssert <LogModuleType>("输入依懒Key已经存在", LogModuleType.LogManager);
            }
            cache_cachesite cache_cachesite = this.cache_cachesite.FirstOrDefault((cache_cachesite s) => s.CacheSiteID == objcache_cachekey.CacheSiteID);

            objcache_cachekey.IDPath = cache_cachesite.IDPath;
            this.CurrentEntities.AddTocache_cachekey(objcache_cachekey);
            this.CurrentEntities.SaveChanges();
            if (objcache_cachekey.CacheKey.IsNull())
            {
                objcache_cachekey.CacheKey = cache_cachesite.CachePrefix + "_" + objcache_cachekey.CacheKeyID;
                this.CurrentEntities.SaveChanges();
            }
        }