예제 #1
0
 private static int CompareItems(ValItem item1, ValItem item2)
 {
     return(item1.Value.CompareTo(item2.Value));
 }
예제 #2
0
 public ValKeyItem(StorageKeyEntry keyEntry, SaveableValueSection value) : base(keyEntry.StorageKey)
 {
     ValItem = new ValItem(keyEntry, value);
 }
예제 #3
0
        public static void Fill_Identification_Form(string groupe, FlowLayoutPanel flp)
        {
            XmlNode        root;
            string         unite  = string.Empty;
            bool           ajoute = false;
            XPathNavigator IdItem;
            XPathNavigator ValItem;
            XPathNavigator IntituleItem;
            XPathNavigator RenseigneItem;
            XPathNavigator InspectItem;

            root = mod_global.Get_Codes_Id_DocElement();

            flp.Controls.Clear();

            //On utilise un navigateur pour pouvoir trier les noeuds
            XPathNavigator  nav = root.CreateNavigator();
            XPathExpression exp = nav.Compile(string.Concat("//code[@parent='", groupe, "']"));

            exp.AddSort("@position", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number);

            foreach (XPathNavigator item in nav.Select(exp))
            {
                IdItem        = item.SelectSingleNode("id");
                ValItem       = item.SelectSingleNode("valeur");
                IntituleItem  = item.SelectSingleNode("intitule");
                RenseigneItem = item.SelectSingleNode("renseigne");
                InspectItem   = item.SelectSingleNode("inspection");

                if (InspectItem.GetAttribute("corresp", "") == "")
                {
                    if (item.GetAttribute("ajoute", "") != "")
                    {
                        ajoute = bool.Parse(item.GetAttribute("ajoute", ""));
                    }

                    string nom_complet = IdItem.Value + " | " + IntituleItem.Value;

                    unite = Get_Unite_For_Id_Code(IdItem.Value);
                    if (unite != string.Empty)
                    {
                        nom_complet += " (" + unite + ")";
                    }

                    string value = Get_Value_Identification(IdItem.Value);

                    identification_input id_box = new identification_input(nom_complet, IdItem.Value, value, RenseigneItem.Value, ValItem.GetAttribute("type", ""), ajoute, groupe);

                    ajoute = false;
                    flp.Controls.Add(id_box);
                }
            }

            /* ANCIEN CODE DE NS (remplacé par GB le 16/12/2009)
             * XmlNodeList nodeList;
             * XmlNode IdNode;
             * XmlNode ValNode;
             * XmlNode IntituleNode;
             * XmlNode RenseigneNode;
             *
             * nodeList = root.SelectNodes(string.Concat("//code[@parent='", groupe, "']"));
             *
             * foreach (XmlNode unNode in nodeList)
             * {
             *  IdNode = unNode.SelectSingleNode("id");
             *  ValNode = unNode.SelectSingleNode("valeur");
             *  IntituleNode = unNode.SelectSingleNode("intitule");
             *  RenseigneNode = unNode.SelectSingleNode("renseigne");
             *
             *  if (unNode.Attributes.GetNamedItem("ajoute") != null)
             *      ajoute = bool.Parse(unNode.Attributes.GetNamedItem("ajoute").InnerText);
             *
             *  string nom_complet = IdNode.InnerText + " | " + IntituleNode.InnerText;
             *
             *  unite = Get_Unite_For_Id_Code(IdNode.InnerText);
             *  if (unite != string.Empty)
             *      nom_complet += " (" + unite + ")";
             *
             *  string value = Get_Value_Identification(IdNode.InnerText);
             *
             *  identification_input id_box = new identification_input(nom_complet, IdNode.InnerText, value, RenseigneNode.InnerText, ValNode.Attributes["type"].InnerText, ajoute, groupe);
             *
             *  ajoute = false;
             *  flp.Controls.Add(id_box);
             * }
             */
        }