Пример #1
0
        public static IList <ELongBaseCodeAdapter> GetBaseCodeList()
        {
            IList <ELongBaseCodeAdapter> list = new List <ELongBaseCodeAdapter>();
            XmlDocument doc = GetDoc(PATH_BASE_CODE_CN);

            string[] codeTypes = new string[] { "star", "guaranteeType", "orderStatus", "guestType", "paymentType", "currencyId", "confirmType", "language", "gender", "idType", "Cancel", "Transportation", "Typology", "Inventory", "Business", "BookingRuleType", "DRRType", "CancelRuleType" };
            foreach (string codeType in codeTypes)
            {
                XmlNodeList nodes = doc.GetElementsByTagName(codeType);
                foreach (XmlNode node in nodes)
                {
                    ELongBaseCodeAdapter basecode = new ELongBaseCodeAdapter();
                    if (node.Attributes["value"] == null)
                    {
                        basecode.value = node.Attributes["vallue"].Value;
                    }
                    else
                    {
                        basecode.value = node.Attributes["value"].Value;
                    }

                    basecode.text = node.InnerText;
                    basecode.type = codeType;
                    list.Add(basecode);
                }
            }
            return(list);
        }
Пример #2
0
 public void from(ELongBaseCodeAdapter basecode)
 {
     this.text = basecode.text;
     this.type = basecode.type;
     this.value = basecode.value;
     this.id = this.createPk().ToString();
 }
Пример #3
0
        public static IList<ELongBaseCodeAdapter> GetBaseCodeList()
        {
            IList<ELongBaseCodeAdapter> list = new List<ELongBaseCodeAdapter>();
            XmlDocument doc = GetDoc(PATH_BASE_CODE_CN);
            string[] codeTypes = new string[] { "star", "guaranteeType", "orderStatus", "guestType", "paymentType", "currencyId", "confirmType", "language", "gender", "idType", "Cancel", "Transportation", "Typology", "Inventory", "Business", "BookingRuleType", "DRRType", "CancelRuleType" };
            foreach (string codeType in codeTypes) {
                XmlNodeList nodes = doc.GetElementsByTagName(codeType);
                foreach (XmlNode node in nodes) {
                    ELongBaseCodeAdapter basecode = new ELongBaseCodeAdapter();
                    if (node.Attributes["value"] == null)
                    {
                        basecode.value = node.Attributes["vallue"].Value;
                    }
                    else {
                        basecode.value = node.Attributes["value"].Value;
                    }

                    basecode.text = node.InnerText;
                    basecode.type = codeType;
                    list.Add(basecode);
                }
            }
            return list;
        }