public static bool UpdateProductNode(int subjectId, string type, System.Collections.Generic.Dictionary <string, string> simplenode) { string filename = HttpContext.Current.Request.MapPath(HiContext.Current.GetSkinPath() + "/config/Products.xml"); bool result = false; XmlDocument productDocument = TagsHelper.GetProductDocument(); XmlNode xmlNode = TagsHelper.FindProductNode(subjectId, type); if (xmlNode != null) { foreach (System.Collections.Generic.KeyValuePair <string, string> current in simplenode) { xmlNode.Attributes[current.Key].Value = current.Value; } productDocument.Save(filename); TagsHelper.RemoveProductNodeCache(); result = true; } return(result); }
public static XmlNode FindProductNode(int subjectId, string type) { XmlDocument productDocument = TagsHelper.GetProductDocument(); return(productDocument.SelectSingleNode(string.Format("//Subject[@SubjectId='{0}' and @Type='{1}']", subjectId, type))); }