public static void Init_Fields_Status(C1TopicBar Tb) { foreach (C1TopicPage Tp in Tb.Pages) { Check_Fields_Status(Tp); } }
public static void Fill_Code_Menu(C1TopicBar tpbar) { Clear_Observation_Tab(tpbar); Get_Groupe_Observation(tpbar); Get_Code_Observation(tpbar); Remove_Empty_Pages(tpbar); }
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); * }*/ }
public static void Get_Groupe_Identification(C1TopicBar tpbar) { XmlNodeList myChildNode = Groupe_Codes_Id_Xml.GetElementsByTagName("titre"); foreach (XmlNode unNode in myChildNode) { C1.Win.C1Command.C1TopicPage c1TopicPage1 = new C1.Win.C1Command.C1TopicPage(); c1TopicPage1.Text = unNode.InnerText; c1TopicPage1.Tag = unNode.Attributes["id"].InnerText; c1TopicPage1.Collapse(); tpbar.Pages.Add(c1TopicPage1); } }
public static void Get_Groupe_Observation(C1TopicBar tpbar) { XmlNodeList myChildNode = Famille_Codes_Xml.GetElementsByTagName("code"); foreach (XmlNode unNode in myChildNode) { C1.Win.C1Command.C1TopicPage c1TopicPage1 = new C1.Win.C1Command.C1TopicPage(); c1TopicPage1.Text = unNode.InnerText + " - " + unNode.Attributes["name"].InnerText; c1TopicPage1.Tag = unNode.Attributes["name"].InnerText; c1TopicPage1.Collapse(); tpbar.Pages.Add(c1TopicPage1); } }
public static void Remove_Empty_Pages(C1TopicBar tpbar) { string tp_index = String.Empty; foreach (C1TopicPage tp in tpbar.Pages) { if (tp.Links.Count == 0) { tp_index += tp.Tag + "|"; } } foreach (string tag in tp_index.Split(char.Parse("|"))) { if (tag != string.Empty) { tpbar.Pages.Remove(tpbar.FindPageByTag(tag)); } } }
//------------------------------------------------------------------------- public static void Fill_Insp_Menu(C1TopicBar tpbar, FlowLayoutPanel flp) { Clear_Inspection_Tab(tpbar, flp); Get_Groupe_Inspection(tpbar); Get_Code_Inspection(tpbar); // Supprimer les parents vides for (int i = 0; i < tpbar.Pages.Count; i++) { if (tpbar.Pages[i].Links.Count == 0) { tpbar.Pages.Remove(tpbar.Pages[i]); } } Init_Fields_Status(tpbar); //on initialise le flag de sauvegarde SaveIDFlag = false; }
public static void Clear_Identification_Tab(C1TopicBar tpbar, FlowLayoutPanel flp) { mod_global.MF.IdFormLabel.Text = String.Empty; tpbar.Pages.Clear(); flp.Controls.Clear(); }
//--------------------------------------------------------------------------------------- // //--------------------------------------------------------------------------------------- public static void Clear_Observation_Tab(C1TopicBar tpbar) { tpbar.Pages.Clear(); }