public static DataTable GetHeaderMune() { XmlDocument headMenuDocument = TagsHelper.GetHeadMenuDocument(); DataTable dataTable = new DataTable(); dataTable.Columns.Add("Title"); dataTable.Columns.Add("DisplaySequence", typeof(int)); dataTable.Columns.Add("Category"); dataTable.Columns.Add("Url"); dataTable.Columns.Add("Where"); dataTable.Columns.Add("Visible"); XmlNodeList childNodes = headMenuDocument.SelectSingleNode("root").ChildNodes; foreach (XmlNode item in childNodes) { if (item.Attributes["Visible"].Value.ToLower() == "true") { DataRow dataRow = dataTable.NewRow(); dataRow["Title"] = item.Attributes["Title"].Value; dataRow["DisplaySequence"] = int.Parse(item.Attributes["DisplaySequence"].Value); dataRow["Category"] = item.Attributes["Category"].Value; dataRow["Url"] = item.Attributes["Url"].Value; dataRow["Where"] = item.Attributes["Where"].Value; dataRow["Visible"] = item.Attributes["Visible"].Value; dataTable.Rows.Add(dataRow); } } return(dataTable); }
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); }
public static XmlNode FindCommentNode(int id, string type) { XmlDocument commentDocument = TagsHelper.GetCommentDocument(); return(commentDocument.SelectSingleNode($"//Comment[@Id='{id}' and @Type='{type}']")); }
public static XmlNode FindAdNode(int id, string type) { XmlDocument adDocument = TagsHelper.GetAdDocument(); return(adDocument.SelectSingleNode($"//Ad[@Id='{id}' and @Type='{type}']")); }
public static XmlNode FindProductNode(int subjectId, string type) { XmlDocument productDocument = TagsHelper.GetProductDocument(); return(productDocument.SelectSingleNode($"//Subject[@SubjectId='{subjectId}' and @Type='{type}']")); }