コード例 #1
0
ファイル: TagsHelper.cs プロジェクト: spiltservice/cloudshop
        public static bool UpdateCommentNode(int commentId, string type, Dictionary <string, string> commentnode)
        {
            bool        result          = false;
            string      filename        = HttpContext.Current.Request.MapPath(HiContext.Current.GetPCHomePageSkinPath() + "/config/Comments.xml");
            XmlDocument commentDocument = TagsHelper.GetCommentDocument();
            XmlNode     xmlNode         = TagsHelper.FindCommentNode(commentId, type);

            if (xmlNode != null)
            {
                foreach (KeyValuePair <string, string> item in commentnode)
                {
                    xmlNode.Attributes[item.Key].Value = item.Value;
                }
                commentDocument.Save(filename);
                new AspNetCache().Remove("CommentFileCache-Admin");
                result = true;
            }
            return(result);
        }
コード例 #2
0
ファイル: TagsHelper.cs プロジェクト: spiltservice/cloudshop
        public static XmlNode FindCommentNode(int id, string type)
        {
            XmlDocument commentDocument = TagsHelper.GetCommentDocument();

            return(commentDocument.SelectSingleNode($"//Comment[@Id='{id}' and @Type='{type}']"));
        }