Exemplo n.º 1
0
    /// <summary>
    /// 保存信息
    /// </summary>
    public void SaveInfo()
    {
        if (CacheSiteID.IsNull())
        {
            ///站点名称
            objcache_cachesite.SiteName = txtSiteName.TextCutWord(100);
            ///备注
            objcache_cachesite.Remark = txtRemark.TextCutWord(200);
            ///父节点
            objcache_cachesite.ParentID    = ParentID;
            objcache_cachesite.CachePrefix = txtCachePrefix.TextCutWord(50);

            ///创建时间
            objcache_cachesite.CreateDate = DateTime.Now;
            objCacheKeyRule.Insertcachesite(objcache_cachesite);

            RefreshFrame("frmCacheSiteTree", "CacheTree.aspx?CacheSiteID=" + objcache_cachesite.CacheSiteID, "新增成功", "CacheKeyList.aspx?CacheSiteID=" + objcache_cachesite.CacheSiteID);
        }
        else
        {
            objcache_cachesite = objCacheKeyRule.cache_cachesite.FirstOrDefault(p => p.CacheSiteID == CacheSiteID);
            if (CheckEditObjectIsNull(objcache_cachesite))
            {
                return;
            }
            ///站点名称
            objcache_cachesite.SiteName = txtSiteName.TextCutWord(100);
            ///备注
            objcache_cachesite.Remark      = txtRemark.TextCutWord(200);
            objcache_cachesite.CachePrefix = txtCachePrefix.TextCutWord(50);
            objCacheKeyRule.Updatecachesite(objcache_cachesite);
            RefreshFrame("frmCacheSiteTree", "CacheTree.aspx?CacheSiteID=" + CacheSiteID, "新增成功", "CacheKeyList.aspx?CacheSiteID=" + CacheSiteID);
        }
    }
Exemplo n.º 2
0
        public int Deletecachesite(int cachesiteID)
        {
            cache_cachesite cache_cachesite = this.cache_cachesite.FirstOrDefault((cache_cachesite s) => s.CacheSiteID == cachesiteID);
            string          iDPath          = cache_cachesite.IDPath;

            this.cache_cachesite.DeleteDataSql("IDPath like '" + iDPath + "%'", new object[0]);
            return(cache_cachesite.ParentID);
        }
Exemplo n.º 3
0
        public string GetSiteXmlText(string url)
        {
            List <cache_cachesite> list            = this.CurrentEntities.cache_cachesite.ToList <cache_cachesite>();
            cache_cachesite        cache_cachesite = list.FirstOrDefault((cache_cachesite s) => s.ParentID == 0);
            XmlDocument            xmlDocument     = new XmlDocument();
            XmlElement             xmlElement      = xmlDocument.CreateElement("TreeNodeMember");

            xmlElement.SetAttribute("TreeNodeID", cache_cachesite.CacheSiteID.ToString());
            xmlElement.SetAttribute("TreeNodeName", cache_cachesite.SiteName);
            xmlElement.SetAttribute("NavigateUrl", string.Format(url + "?CacheSiteID={0}", cache_cachesite.CacheSiteID.ToString()).EncryptModuleQuery());
            xmlDocument.AppendChild(xmlElement);
            this.CreateChildSiteXmlElement(xmlDocument, cache_cachesite.CacheSiteID, xmlElement, list, url);
            return(xmlDocument.InnerXml);
        }
Exemplo n.º 4
0
        public void Insertcachesite(cache_cachesite objcache_cachesite)
        {
            objcache_cachesite.SiteName.CheckIsNull("请输入站点名称", LogModuleType.ParameterLog);
            objcache_cachesite.CachePrefix.CheckIsNull("请输入缓存前缀", LogModuleType.ParameterLog);
            objcache_cachesite.SortIndex  = 0;
            objcache_cachesite.IDPath     = "";
            objcache_cachesite.CreateDate = DateTime.Now;
            this.CurrentEntities.AddTocache_cachesite(objcache_cachesite);
            this.CurrentEntities.SaveChanges();
            cache_cachesite cache_cachesite = this.cache_cachesite.FirstOrDefault((cache_cachesite s) => s.CacheSiteID == objcache_cachesite.ParentID);

            objcache_cachesite.SortIndex = objcache_cachesite.CacheSiteID;
            objcache_cachesite.IDPath    = cache_cachesite.IDPath + objcache_cachesite.CacheSiteID + ",";
            this.CurrentEntities.SaveChanges();
        }
Exemplo n.º 5
0
    /// <summary>
    /// 页面加载
    /// </summary>
    public override void RenderPage()
    {
        if (CacheSiteID.IsNoNull())
        {
            objcache_cachesite = objCacheKeyRule.cache_cachesite.FirstOrDefault(s => s.CacheSiteID == CacheSiteID);
            if (CheckEditObjectIsNull(objcache_cachesite))
            {
                return;
            }

            Page.DataBind();
        }
        else
        {
        }
    }
Exemplo n.º 6
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();
 }
Exemplo n.º 7
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();
            }
        }
Exemplo n.º 8
0
 public void Updatecachesite(cache_cachesite objcache_cachesite)
 {
     objcache_cachesite.SiteName.CheckIsNull("请输入站点名称", LogModuleType.ParameterLog);
     objcache_cachesite.CachePrefix.CheckIsNull("请输入缓存前缀", LogModuleType.ParameterLog);
     this.CurrentEntities.SaveChanges();
 }