public static bool UpdateAdNode(int aId, string type, System.Collections.Generic.Dictionary <string, string> adnode) { bool result = false; XmlDocument adDocument = TagsHelper.GetAdDocument(); XmlNode xmlNode = TagsHelper.FindAdNode(aId, type); if (xmlNode != null) { foreach (System.Collections.Generic.KeyValuePair <string, string> current in adnode) { xmlNode.Attributes[current.Key].Value = current.Value; } string filename = HttpContext.Current.Request.MapPath(HiContext.Current.GetSkinPath() + "/config/Ads.xml"); adDocument.Save(filename); TagsHelper.RemoveAdNodeCache(); result = true; } return(result); }
public static XmlNode FindAdNode(int int_0, string type) { XmlDocument adDocument = TagsHelper.GetAdDocument(); return(adDocument.SelectSingleNode(string.Format("//Ad[@Id='{0}' and @Type='{1}']", int_0, type))); }