public static void Get_Code_Identification(C1TopicBar tpbar) { XmlNode root; XPathNavigator IdItem; XPathNavigator IntituleItem; XPathNavigator InspectItem; root = mod_global.Get_Codes_Id_DocElement(); //On utilise un navigateur pour pouvoir trier les noeuds XPathNavigator nav = root.CreateNavigator(); XPathExpression exp = nav.Compile("//code"); exp.AddSort("@position", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number); foreach (XPathNavigator item in nav.Select(exp)) { IdItem = item.SelectSingleNode("id"); IntituleItem = item.SelectSingleNode("intitule"); InspectItem = item.SelectSingleNode("inspection"); if (InspectItem.GetAttribute("corresp", "") == "") { C1.Win.C1Command.C1TopicLink link = new C1.Win.C1Command.C1TopicLink(); if (item.GetAttribute("ajoute", "") == "true") { link.Text = string.Concat("** " + IntituleItem.Value, " - ", IdItem.Value); } else { link.Text = string.Concat(IntituleItem.Value, " - ", IdItem.Value); } link.Tag = IdItem.Value; tpbar.FindPageByTag(item.GetAttribute("parent", "")).Links.Add(link); } } /* ANCIEN CODE DE NS (remplacé par GB le 16/12/2009) * XmlNodeList nodeList; * XmlNode IdNode; * XmlNode IntituleNode; * * //nodeList = root.SelectNodes(string.Concat("//code")); * * foreach (XmlNode unNode in nodeList) * { * IdNode = unNode.SelectSingleNode("id"); * IntituleNode = unNode.SelectSingleNode("intitule"); * * C1.Win.C1Command.C1TopicLink link = new C1.Win.C1Command.C1TopicLink(); * link.Text = string.Concat(IntituleNode.InnerText, " - ", IdNode.InnerText); * link.Tag = IdNode.InnerText; * tpbar.FindPageByTag(unNode.Attributes["parent"].InnerText).Links.Add(link); * }*/ }
public static void Get_Code_Observation(C1TopicBar tpbar) { XmlNode root; XPathNavigator IdItem; XPathNavigator IntituleItem; root = mod_global.Get_Codes_Obs_DocElement(); //On utilise un navigateur pour pouvoir trier les noeuds XPathNavigator nav = root.CreateNavigator(); XPathExpression exp = nav.Compile("//code"); exp.AddSort("@position", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number); foreach (XPathNavigator item in nav.Select(exp)) { string ajout = String.Empty; ajout = item.GetAttribute("ajoute", ""); IdItem = item.SelectSingleNode("id"); IntituleItem = item.SelectSingleNode("intitule"); C1.Win.C1Command.C1TopicLink link = new C1.Win.C1Command.C1TopicLink(); if (ajout != "true") { link.Text = string.Concat(IntituleItem.Value, " - ", IdItem.Value); } else { link.Text = string.Concat("** ", IntituleItem.Value, " - ", IdItem.Value); } link.Tag = IdItem.Value; tpbar.FindPageByTag(IdItem.Value.Substring(0, 2)).Links.Add(link); } /* * XmlNodeList myChildNode; * * if (mod_inspection.TYPE_OUVRAGE == "REGARD") * myChildNode = Codes_Obs_Regard_Xml.GetElementsByTagName("code"); * else * myChildNode = Codes_Obs_Cana_Xml.GetElementsByTagName("code"); * * foreach (XmlNode unNode in myChildNode) * { * C1.Win.C1Command.C1TopicLink link = new C1.Win.C1Command.C1TopicLink(); * link.Text = string.Concat(unNode.ChildNodes[1].InnerText, " - ", unNode.ChildNodes[0].InnerText); * link.Tag = unNode.ChildNodes[0].InnerText; * tpbar.FindPageByTag(unNode.ChildNodes[0].InnerText.Substring(0,2)).Links.Add(link); * }*/ }