protected void GV_List_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { InspectItem inspectItem = (InspectItem)e.Row.DataItem; if (inspectItem.IsBlank) { e.Row.FindControl("lblItemCode").Visible = false; e.Row.FindControl("tbItemCode").Visible = true; } else { e.Row.FindControl("lblItemCode").Visible = true; e.Row.FindControl("tbItemCode").Visible = false; } } }
public void InitPageParameter() { IList <InspectItem> inspectItemList = new List <InspectItem>(); foreach (string itemCode in this.InspectItemDic.Keys) { InspectItem inspectItem = new InspectItem(); inspectItem.IsBlank = false; inspectItem.InspectQty = InspectItemDic[itemCode]; inspectItem.Item = TheItemMgr.LoadItem(itemCode); inspectItemList.Add(inspectItem); } //新行 InspectItem blankInspectItem = new InspectItem(); blankInspectItem.IsBlank = true; inspectItemList.Add(blankInspectItem); this.GV_List.DataSource = inspectItemList; this.GV_List.DataBind(); }
public override void Execute() { WriteLiteral("\r\n"); Layout = "~/Views/ElasticSearchAdmin/_ElasticSearch.cshtml"; WriteLiteral("\r\n\r\n"); if (Model == null) { return; } WriteLiteral("\r\n"); string localizationPath = "/epinovaelasticsearch/indexinspector/"; WriteLiteral("\r\n\r\n"); DefineSection("Scripts", () => { WriteLiteral(@" <script> document.addEventListener('DOMContentLoaded', function () { var accordions = document.getElementsByClassName(""_jsAccordion""); for (var i = 0; i < accordions.length; i++) { accordions[i].onclick = function (e) { e.preventDefault(); if (this.getAttribute('aria-expanded') === 'false') { this.setAttribute(""aria-expanded"", ""true""); } else { this.setAttribute(""aria-expanded"", ""false""); } var controls = this.getAttribute('aria-controls'), content = document.getElementById(controls); if (content.style.display === ""block"") { content.style.display = ""none""; } else { content.style.display = ""block""; } } } }, false); </script> "); }); WriteLiteral("\r\n<div"); WriteLiteral(" class=\"epi-formArea epi-padding-small\""); WriteLiteral(">\r\n <h1"); WriteLiteral(" class=\"EP-prefix\""); WriteLiteral(">"); Write(Html.TranslateWithPath("heading", localizationPath)); WriteLiteral("</h1>\r\n\r\n"); using (Html.BeginForm("Index", "ElasticIndexInspector")) { WriteLiteral(" <div"); WriteLiteral(" class=\"indexInspector\""); WriteLiteral(">\r\n <div"); WriteLiteral(" class=\"mainContent\""); WriteLiteral(">\r\n <p>\r\n <input"); WriteLiteral(" data-dojo-type=\"dijit/form/ValidationTextBox\""); WriteLiteral(" data-dojo-props=\"placeholder:\'"); Write(Html.TranslateWithPathRaw("placeholder", localizationPath)); WriteLiteral("\'\""); WriteLiteral(" name=\"searchText\""); WriteAttribute("value", Tuple.Create(" value=\"", 1953), Tuple.Create("\"", 1978) , Tuple.Create(Tuple.Create("", 1961), Tuple.Create <System.Object, System.Int32>(Model.SearchText , 1961), false) ); WriteLiteral(" />\r\n <button"); WriteLiteral(" data-dojo-type=\"dijit/form/Button\""); WriteLiteral(" type=\"submit\""); WriteLiteral(" class=\"epi-primary\""); WriteLiteral(">"); Write(Html.TranslateWithPath("execute", localizationPath)); WriteLiteral("</button>\r\n </p>\r\n\r\n"); if (String.IsNullOrWhiteSpace(Model.SearchText) && String.IsNullOrWhiteSpace(Model.SelectedType)) { WriteLiteral(" <h2>"); Write(Html.TranslateWithPath("unfiltered", localizationPath)); WriteLiteral("</h2>\r\n"); } else if (Model.SearchHits == null || !Model.SearchHits.Any()) { WriteLiteral(" <h2>"); Write(Html.TranslateWithPath("nohits", localizationPath)); WriteLiteral("</h2>\r\n"); } else { WriteLiteral(" <ol"); WriteLiteral(" class=\"indexes\""); WriteLiteral(">\r\n"); for (var index = 0; index < Model.SearchHits.Count; index++) { InspectItem item = Model.SearchHits[index]; WriteLiteral(" <li"); WriteLiteral(" class=\"accordion\""); WriteLiteral(">\r\n <h3>\r\n <but" + "ton"); WriteLiteral(" type=\"button\""); WriteAttribute("aria-controls", Tuple.Create(" aria-controls=\"", 3024), Tuple.Create("\"", 3051) , Tuple.Create(Tuple.Create("", 3040), Tuple.Create("item-", 3040), true) , Tuple.Create(Tuple.Create("", 3045), Tuple.Create <System.Object, System.Int32>(index , 3045), false) ); WriteLiteral(" aria-expanded=\"false\""); WriteLiteral(" class=\"_jsAccordion\""); WriteLiteral(">"); Write(item.Title); WriteLiteral(" - <i>"); Write(item.ShortTypeName); WriteLiteral("</i></button>\r\n </h3>\r\n " + " <div"); WriteLiteral(" class=\"accordion-panel\""); WriteLiteral(" style=\"display: none;\""); WriteAttribute("id", Tuple.Create(" id=\"", 3269), Tuple.Create("\"", 3285) , Tuple.Create(Tuple.Create("", 3274), Tuple.Create("item-", 3274), true) , Tuple.Create(Tuple.Create("", 3279), Tuple.Create <System.Object, System.Int32>(index , 3279), false) ); WriteLiteral(">\r\n <pre><code>"); Write(item.Content); WriteLiteral("</code></pre>\r\n </div>\r\n " + " </li>\r\n"); } WriteLiteral(" </ol>\r\n"); } WriteLiteral(" </div>\r\n <div"); WriteLiteral(" class=\"sidebar\""); WriteLiteral(">\r\n"); if (Model.Indices != null && Model.Indices.Count > 1) { WriteLiteral(" <h2>"); Write(Html.TranslateWithPath("indexes", localizationPath)); WriteLiteral("</h2>\r\n"); WriteLiteral(" <ul>\r\n"); foreach (string index in Model.Indices) { WriteLiteral(" <li>\r\n <label>\r\n " + " <input"); WriteLiteral(" type=\"radio\""); WriteLiteral(" data-dojo-type=\"dijit/form/RadioButton\""); WriteAttribute("name", Tuple.Create(" name=\"", 4030), Tuple.Create("\"", 4072) , Tuple.Create(Tuple.Create("", 4037), Tuple.Create <System.Object, System.Int32>(Html.NameFor(m => m.SelectedIndex) , 4037), false) ); WriteAttribute("value", Tuple.Create(" value=\"", 4073), Tuple.Create("\"", 4087) , Tuple.Create(Tuple.Create("", 4081), Tuple.Create <System.Object, System.Int32>(index , 4081), false) ); WriteAttribute("checked", Tuple.Create(" checked=\"", 4088), Tuple.Create("\"", 4141) , Tuple.Create(Tuple.Create("", 4098), Tuple.Create <System.Object, System.Int32>(Model.SelectedIndex == index ? "" : null , 4098), false) ); WriteLiteral(" /> "); Write(index); WriteLiteral("\r\n </label>\r\n </li>\r\n"); } WriteLiteral(" </ul>\r\n"); WriteLiteral(" <p>\r\n <button"); WriteLiteral(" data-dojo-type=\"dijit/form/Button\""); WriteLiteral(" type=\"submit\""); WriteLiteral(" class=\"epi-primary _jsAccordion\""); WriteLiteral(">"); Write(Html.TranslateWithPath("execute", localizationPath)); WriteLiteral("</button>\r\n </p>\r\n"); } WriteLiteral("\r\n <h2>"); Write(Html.TranslateWithPath("count", localizationPath)); WriteLiteral("</h2>\r\n <ul>\r\n"); foreach (int numberOfItems in Model.NumberOfItems) { WriteLiteral(" <li>\r\n <label>\r\n " + " <input"); WriteLiteral(" type=\"radio\""); WriteLiteral(" data-dojo-type=\"dijit/form/RadioButton\""); WriteAttribute("name", Tuple.Create(" name=\"", 4887), Tuple.Create("\"", 4937) , Tuple.Create(Tuple.Create("", 4894), Tuple.Create <System.Object, System.Int32>(Html.NameFor(m => m.SelectedNumberOfItems) , 4894), false) ); WriteAttribute("value", Tuple.Create(" value=\"", 4938), Tuple.Create("\"", 4960) , Tuple.Create(Tuple.Create("", 4946), Tuple.Create <System.Object, System.Int32>(numberOfItems , 4946), false) ); WriteAttribute("checked", Tuple.Create(" checked=\"", 4961), Tuple.Create("\"", 5030) , Tuple.Create(Tuple.Create("", 4971), Tuple.Create <System.Object, System.Int32>(numberOfItems == Model.SelectedNumberOfItems ? "" : null , 4971), false) ); WriteLiteral(" /> "); Write(numberOfItems); WriteLiteral("\r\n </label>\r\n </li>\r\n"); } WriteLiteral(" </ul>\r\n <p>\r\n <button"); WriteLiteral(" data-dojo-type=\"dijit/form/Button\""); WriteLiteral(" type=\"submit\""); WriteLiteral(" class=\"epi-primary _jsAccordion\""); WriteLiteral(">"); Write(Html.TranslateWithPath("execute", localizationPath)); WriteLiteral("</button>\r\n </p>\r\n\r\n"); if (Model.Languages != null && Model.Languages.Count > 1) { WriteLiteral(" <h2>"); Write(Html.TranslateWithPath("languages", localizationPath)); WriteLiteral("</h2>\r\n"); WriteLiteral(" <ul>\r\n"); foreach (var language in Model.Languages) { WriteLiteral(" <li>\r\n <label>\r\n " + " <input"); WriteLiteral(" type=\"radio\""); WriteLiteral(" data-dojo-type=\"dijit/form/RadioButton\""); WriteAttribute("name", Tuple.Create(" name=\"", 5855), Tuple.Create("\"", 5900) , Tuple.Create(Tuple.Create("", 5862), Tuple.Create <System.Object, System.Int32>(Html.NameFor(m => m.SelectedLanguage) , 5862), false) ); WriteAttribute("value", Tuple.Create(" value=\"", 5901), Tuple.Create("\"", 5929) , Tuple.Create(Tuple.Create("", 5909), Tuple.Create <System.Object, System.Int32>(language.LanguageID , 5909), false) ); WriteAttribute("checked", Tuple.Create(" checked=\"", 5930), Tuple.Create("\"", 6000) , Tuple.Create(Tuple.Create("", 5940), Tuple.Create <System.Object, System.Int32>(Model.SelectedLanguage == language.LanguageID ? "" : null , 5940), false) ); WriteLiteral(" /> "); Write(language.Name); WriteLiteral("\r\n </label>\r\n </li>\r\n"); } WriteLiteral(" </ul>\r\n"); WriteLiteral(" <p>\r\n <button"); WriteLiteral(" data-dojo-type=\"dijit/form/Button\""); WriteLiteral(" type=\"submit\""); WriteLiteral(" class=\"epi-primary _jsAccordion\""); WriteLiteral(">"); Write(Html.TranslateWithPath("execute", localizationPath)); WriteLiteral("</button>\r\n </p>\r\n"); } WriteLiteral("\r\n <h2>"); Write(Html.TranslateWithPath("types", localizationPath)); WriteLiteral("</h2>\r\n\r\n"); foreach (var group in Model.TypeCounts) { WriteLiteral(" <h3>"); Write(group.Key); WriteLiteral("</h3>\r\n"); WriteLiteral(" <ul>\r\n"); foreach (var type in group.Value) { WriteLiteral(" <li>\r\n <label>\r\n " + " <input"); WriteLiteral(" type=\"radio\""); WriteLiteral(" data-dojo-type=\"dijit/form/RadioButton\""); WriteAttribute("name", Tuple.Create(" name=\"", 6881), Tuple.Create("\"", 6922) , Tuple.Create(Tuple.Create("", 6888), Tuple.Create <System.Object, System.Int32>(Html.NameFor(m => m.SelectedType) , 6888), false) ); WriteAttribute("value", Tuple.Create(" value=\"", 6923), Tuple.Create("\"", 6941) , Tuple.Create(Tuple.Create("", 6931), Tuple.Create <System.Object, System.Int32>(type.Type , 6931), false) ); WriteAttribute("checked", Tuple.Create(" checked=\"", 6942), Tuple.Create("\"", 6998) , Tuple.Create(Tuple.Create("", 6952), Tuple.Create <System.Object, System.Int32>(Model.SelectedType == type.Type ? "" : null , 6952), false) ); WriteLiteral(" /> "); Write(type.Name); WriteLiteral(" ("); Write(type.Count); WriteLiteral(")\r\n </label>\r\n </li>\r\n"); } WriteLiteral(" </ul>\r\n"); } WriteLiteral(" <p>\r\n <button"); WriteLiteral(" data-dojo-type=\"dijit/form/Button\""); WriteLiteral(" type=\"submit\""); WriteLiteral(" class=\"epi-primary _jsAccordion\""); WriteLiteral(">"); Write(Html.TranslateWithPath("execute", localizationPath)); WriteLiteral("</button>\r\n </p>\r\n </div>\r\n </div>\r\n"); } WriteLiteral("</div> "); }
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); * } */ }
public override void Execute() { WriteLiteral("\r\n"); WriteLiteral("\r\n"); Layout = "~/Views/ElasticSearchAdmin/_ElasticSearch.cshtml"; WriteLiteral("\r\n\r\n"); if (Model == null) { return; } WriteLiteral("\r\n"); string localizationPath = "/epinovaelasticsearch/indexinspector/"; WriteLiteral("\r\n\r\n"); DefineSection("Scripts", () => { WriteLiteral(@" <script> document.addEventListener('DOMContentLoaded', function () { var accordions = document.getElementsByClassName(""_jsAccordion""); for (var i = 0; i < accordions.length; i++) { accordions[i].onclick = function (e) { e.preventDefault(); if (this.getAttribute('aria-expanded') === 'false') { this.setAttribute(""aria-expanded"", ""true""); } else { this.setAttribute(""aria-expanded"", ""false""); } var controls = this.getAttribute('aria-controls'), content = document.getElementById(controls); if (content.style.display === ""block"") { content.style.display = ""none""; } else { content.style.display = ""block""; } } } }, false); </script> "); }); WriteLiteral("\r\n<div"); WriteLiteral(" id=\"tabContainer\""); WriteLiteral(">\r\n <div"); WriteLiteral(" data-dojo-type=\"dijit/layout/TabContainer\""); WriteLiteral(" doLayout=\"false\""); WriteLiteral(">\r\n"); foreach (var lang in Model.Languages) { WriteLiteral(" <div"); WriteLiteral(" data-dojo-type=\"dijit/layout/ContentPane\""); WriteAttribute("title", Tuple.Create(" title=\"", 1721), Tuple.Create("\"", 1747) , Tuple.Create(Tuple.Create("", 1729), Tuple.Create <System.Object, System.Int32>(lang.LanguageName , 1729), false) ); WriteLiteral(" data-dojo-props=\""); Write(lang.LanguageId == Model.CurrentLanguage ? "selected:true" : null); WriteLiteral("\""); WriteLiteral(">\r\n <div"); WriteLiteral(" class=\"epi-padding-small\""); WriteLiteral(">\r\n"); if (lang.Indices.Count > 1) { WriteLiteral(" <h2>"); Write(Html.TranslateWithPathRaw("indexes", localizationPath)); WriteLiteral("</h2>\r\n"); WriteLiteral(" <div"); WriteLiteral(" data-dojo-type=\"dijit/form/DropDownButton\""); WriteLiteral(" class=\"epi-primary\""); WriteLiteral(">\r\n <span>"); Write(ViewBag.SelectedIndexName); WriteLiteral("</span>\r\n <div"); WriteLiteral(" data-dojo-type=\"dijit/DropDownMenu\""); WriteLiteral(">\r\n"); foreach (var index in lang.Indices) { var indexName = $"{index.Key}-{lang.LanguageId}"; if (indexName != ViewBag.SelectedIndex) { WriteLiteral(" <div"); WriteLiteral(" data-dojo-type=\"dijit/MenuItem\""); WriteLiteral("\r\n data-dojo-props=\"onClick:functi" + "on(){document.location=\'?index="); Write(indexName); WriteLiteral("&languageId="); Write(lang.LanguageId); WriteLiteral("\';}\""); WriteLiteral(">\r\n"); WriteLiteral(" "); Write(index.Value); WriteLiteral("\r\n </div>\r\n"); } } WriteLiteral(" </div>\r\n </div>\r\n"); } WriteLiteral("\r\n"); using (Html.BeginForm("Index", "ElasticIndexInspector", new { index = ViewBag.SelectedIndex, languageId = Model.CurrentLanguage }, FormMethod.Post, null)) { WriteLiteral(" <div"); WriteLiteral(" class=\"indexInspector\""); WriteLiteral(">\r\n <div"); WriteLiteral(" class=\"mainContent\""); WriteLiteral(">\r\n <h1"); WriteLiteral(" class=\"EP-prefix\""); WriteLiteral(">"); Write(Html.TranslateWithPath("heading", localizationPath)); WriteLiteral("</h1>\r\n <p>\r\n <" + "input"); WriteLiteral(" data-dojo-type=\"dijit/form/ValidationTextBox\""); WriteLiteral(" data-dojo-props=\"placeholder:\'"); Write(Html.TranslateWithPathRaw("placeholder", localizationPath)); WriteLiteral("\'\""); WriteLiteral(" name=\"searchText\""); WriteAttribute("value", Tuple.Create(" value=\"", 3755), Tuple.Create("\"", 3780) , Tuple.Create(Tuple.Create("", 3763), Tuple.Create <System.Object, System.Int32>(Model.SearchText , 3763), false) ); WriteLiteral(" />\r\n <button"); WriteLiteral(" data-dojo-type=\"dijit/form/Button\""); WriteLiteral(" type=\"submit\""); WriteLiteral(" class=\"epi-primary\""); WriteLiteral(">"); Write(Html.TranslateWithPath("execute", localizationPath)); WriteLiteral("</button>\r\n"); WriteLiteral(" "); Write(Html.CheckBoxFor(m => m.Analyzed)); WriteLiteral("\r\n"); WriteLiteral(" "); Write(Html.TranslateWithPath("Analyzed", localizationPath)); WriteLiteral("\r\n </p>\r\n\r\n"); if (String.IsNullOrWhiteSpace(Model.SearchText) && String.IsNullOrWhiteSpace(Model.SelectedType)) { WriteLiteral(" <h2>"); Write(Html.TranslateWithPath("unfiltered", localizationPath)); WriteLiteral("</h2>\r\n"); } else if (Model.SearchHits == null || !Model.SearchHits.Any()) { WriteLiteral(" <h2>"); Write(Html.TranslateWithPath("nohits", localizationPath)); WriteLiteral("</h2>\r\n"); } else { WriteLiteral(" <ol"); WriteLiteral(" class=\"indexes\""); WriteLiteral(">\r\n"); for (var index = 0; index < Model.SearchHits.Count; index++) { InspectItem item = Model.SearchHits[index]; WriteLiteral(" <li"); WriteLiteral(" class=\"accordion\""); WriteLiteral(">\r\n <h3>\r\n " + " <button"); WriteLiteral(" type=\"button\""); WriteAttribute("aria-controls", Tuple.Create(" aria-controls=\"", 5293), Tuple.Create("\"", 5320) , Tuple.Create(Tuple.Create("", 5309), Tuple.Create("item-", 5309), true) , Tuple.Create(Tuple.Create("", 5314), Tuple.Create <System.Object, System.Int32>(index , 5314), false) ); WriteLiteral(" aria-expanded=\"false\""); WriteLiteral(" class=\"_jsAccordion\""); WriteLiteral(">"); Write(item.Title); WriteLiteral(" - <i>"); Write(item.ShortTypeName); WriteLiteral("</i></button>\r\n </h3>\r\n " + " <div"); WriteLiteral(" class=\"accordion-panel\""); WriteLiteral(" style=\"display: none;\""); WriteAttribute("id", Tuple.Create(" id=\"", 5570), Tuple.Create("\"", 5586) , Tuple.Create(Tuple.Create("", 5575), Tuple.Create("item-", 5575), true) , Tuple.Create(Tuple.Create("", 5580), Tuple.Create <System.Object, System.Int32>(index , 5580), false) ); WriteLiteral(">\r\n <pre><code>"); Write(item.Content); WriteLiteral("</code></pre>\r\n </div>\r\n " + " </li>\r\n"); } WriteLiteral(" </ol>\r\n"); } WriteLiteral(" </div>\r\n <div"); WriteLiteral(" class=\"sidebar\""); WriteLiteral(">\r\n <h2>"); Write(Html.TranslateWithPath("count", localizationPath)); WriteLiteral("</h2>\r\n <ul>\r\n"); foreach (int numberOfItems in Model.NumberOfItems) { WriteLiteral(" <li>\r\n " + " <label>\r\n <input"); WriteLiteral(" type=\"radio\""); WriteLiteral(" data-dojo-type=\"dijit/form/RadioButton\""); WriteAttribute("name", Tuple.Create(" name=\"", 6461), Tuple.Create("\"", 6511) , Tuple.Create(Tuple.Create("", 6468), Tuple.Create <System.Object, System.Int32>(Html.NameFor(m => m.SelectedNumberOfItems) , 6468), false) ); WriteAttribute("value", Tuple.Create(" value=\"", 6512), Tuple.Create("\"", 6534) , Tuple.Create(Tuple.Create("", 6520), Tuple.Create <System.Object, System.Int32>(numberOfItems , 6520), false) ); WriteAttribute("checked", Tuple.Create(" checked=\"", 6535), Tuple.Create("\"", 6604) , Tuple.Create(Tuple.Create("", 6545), Tuple.Create <System.Object, System.Int32>(numberOfItems == Model.SelectedNumberOfItems ? "" : null , 6545), false) ); WriteLiteral(" /> "); Write(numberOfItems); WriteLiteral("\r\n </label>\r\n " + " </li>\r\n"); } WriteLiteral(" </ul>\r\n <p>\r\n " + " <button"); WriteLiteral(" data-dojo-type=\"dijit/form/Button\""); WriteLiteral(" type=\"submit\""); WriteLiteral(" class=\"epi-primary _jsAccordion\""); WriteLiteral(">"); Write(Html.TranslateWithPath("execute", localizationPath)); WriteLiteral("</button>\r\n </p>\r\n\r\n " + " <h2>"); Write(Html.TranslateWithPath("types", localizationPath)); WriteLiteral("</h2>\r\n\r\n"); foreach (var group in Model.TypeCounts) { if (Model.TypeCounts.Count > 1) { WriteLiteral(" <h3>"); Write(group.Key); WriteLiteral("</h3>\r\n"); } WriteLiteral(" <ul>\r\n"); foreach (var type in group.Value.OrderBy(t => t.Name)) { WriteLiteral(" <li>\r\n " + " <label>\r\n <i" + "nput"); WriteLiteral(" type=\"radio\""); WriteLiteral(" data-dojo-type=\"dijit/form/RadioButton\""); WriteAttribute("name", Tuple.Create(" name=\"", 7882), Tuple.Create("\"", 7923) , Tuple.Create(Tuple.Create("", 7889), Tuple.Create <System.Object, System.Int32>(Html.NameFor(m => m.SelectedType) , 7889), false) ); WriteAttribute("value", Tuple.Create(" value=\"", 7924), Tuple.Create("\"", 7942) , Tuple.Create(Tuple.Create("", 7932), Tuple.Create <System.Object, System.Int32>(type.Type , 7932), false) ); WriteAttribute("checked", Tuple.Create(" checked=\"", 7943), Tuple.Create("\"", 7999) , Tuple.Create(Tuple.Create("", 7953), Tuple.Create <System.Object, System.Int32>(Model.SelectedType == type.Type ? "" : null , 7953), false) ); WriteLiteral(" /> "); Write(type.Name); WriteLiteral(" ("); Write(type.Count); WriteLiteral(")\r\n </label>\r\n " + " </li>\r\n"); } WriteLiteral(" </ul>\r\n"); } WriteLiteral(" <p>\r\n <button"); WriteLiteral(" data-dojo-type=\"dijit/form/Button\""); WriteLiteral(" type=\"submit\""); WriteLiteral(" class=\"epi-primary _jsAccordion\""); WriteLiteral(">"); Write(Html.TranslateWithPath("execute", localizationPath)); WriteLiteral("</button>\r\n </p>\r\n </di" + "v>\r\n </div>\r\n"); } WriteLiteral(" </div>\r\n </div>\r\n"); } WriteLiteral(" </div>\r\n</div>"); }
public static void Get_Code_Inspection(C1TopicBar tpbar) { XmlNode root; XPathNavigator IdItem; XPathNavigator IntituleItem; XPathNavigator InspectItem; root = mod_global.Get_Codes_Insp_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(); link.Text = string.Concat(IntituleItem.Value, " - ", IdItem.Value, " / ", InspectItem.GetAttribute("corresp", "")); 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); * }*/ }