Esempio n. 1
0
        // calc any
        private string GetDisabledTokens(NBrightInfo objInfo)
        {
            var searchData = new List<NavigationSearchData>();
            var disabledList = "";
            var hiddenList = objInfo.XMLDoc.SelectNodes("genxml/hidden/*");
            if (hiddenList == null) return "";
            foreach (XmlNode nod in hiddenList)
            {
                var sd = new NavigationSearchData(nod.InnerText);
                if (!String.IsNullOrEmpty(sd.Id) && sd.Id.ToLower().StartsWith("search"))
                {
                   searchData.Add(sd);
                }
            }

            // checkboxes
            var ctrlList = objInfo.XMLDoc.SelectNodes("genxml/checkbox/*");
            if (ctrlList != null)
            {
                foreach (XmlNode nod in ctrlList)
                {
                    // add unchecked to the disabled list
                    if (!Convert.ToBoolean(nod.InnerText))
                    {
                        var f = searchData.FirstOrDefault(a => a.FieldId == nod.Name);
                        if (f != null) disabledList += f.Id + ";" + f.Dependency + ";";
                    }
                }
            }

            // textboxes
            ctrlList = objInfo.XMLDoc.SelectNodes("genxml/textbox/*");
            if (ctrlList != null)
            {
                foreach (XmlNode nod in ctrlList)
                {
                    // add empty to the disabled list
                    if (nod.InnerText == "")
                    {
                        var f = searchData.FirstOrDefault(a => a.FieldId == nod.Name);
                        if (f != null) disabledList += f.Id + ";" + f.Dependency + ";";
                    }
                }
            }

            // dropdownlist
            ctrlList = objInfo.XMLDoc.SelectNodes("genxml/dropdownlist/*");
            if (ctrlList != null)
            {
                foreach (XmlNode nod in ctrlList)
                {
                    // add empty to the disabled list
                    if (nod.InnerText == "")
                    {
                        var f = searchData.FirstOrDefault(a => a.FieldId == nod.Name);
                        if (f != null) disabledList += f.Id + ";" + f.Dependency + ";";
                    }
                }
            }

            return disabledList;
        }
Esempio n. 2
0
        // calc any 
        private string GetDisabledTokens(NBrightInfo objInfo)
        {
            var searchData = new List<NavigationSearchData>();
            var disabledList = "";
            var hiddenList = objInfo.XMLDoc.SelectNodes("genxml/hidden/*");
            if (hiddenList == null) return "";
            foreach (XmlNode nod in hiddenList)
            {
                var sd = new NavigationSearchData(nod.InnerText);
                if (!String.IsNullOrEmpty(sd.Id) && sd.Id.ToLower().StartsWith("search"))
                {
                    searchData.Add(sd);
                }
            }

            // checkboxes
            var ctrlList = objInfo.XMLDoc.SelectNodes("genxml/checkbox/*");
            if (ctrlList != null)
            {
                foreach (XmlNode nod in ctrlList)
                {
                    // add unchecked to the disabled list
                    if (!Convert.ToBoolean(nod.InnerText))
                    {
                        var f = searchData.FirstOrDefault(a => a.FieldId == nod.Name);
                        if (f != null) disabledList += f.Id + ";" + f.Dependency + ";";
                    }
                }
            }

            // textboxes
            ctrlList = objInfo.XMLDoc.SelectNodes("genxml/textbox/*");
            if (ctrlList != null)
            {
                foreach (XmlNode nod in ctrlList)
                {
                    // add empty to the disabled list
                    if (nod.InnerText == "")
                    {
                        var f = searchData.FirstOrDefault(a => a.FieldId == nod.Name);
                        if (f != null) disabledList += f.Id + ";" + f.Dependency + ";";
                    }
                }
            }

            // dropdownlist
            ctrlList = objInfo.XMLDoc.SelectNodes("genxml/dropdownlist/*");
            if (ctrlList != null)
            {
                foreach (XmlNode nod in ctrlList)
                {
                    // add empty to the disabled list
                    if (nod.InnerText == "")
                    {
                        var f = searchData.FirstOrDefault(a => a.FieldId == nod.Name);
                        if (f != null) disabledList += f.Id + ";" + f.Dependency + ";";
                    }
                }
            }


            return disabledList;
        }