示例#1
0
        public string GetSpecialRebate(string key)
        {
            XmlDocument xmldoc    = new XmlDocument();
            Hashtable   hashTable = new Hashtable();
            ListPolicy  lp        = new ListPolicy();

            hashTable = lp.GetHashTableFromXmlString(GlobalVar2.xmlPolicies);
            ListPolicy.PolicyInfomation pi = new ListPolicy.PolicyInfomation();
            pi = (ListPolicy.PolicyInfomation)hashTable[key];
            return(pi.rebate);
        }
示例#2
0
        /// <summary>
        /// 取航班及舱位对应折扣及返点"70~8",基数为100
        /// </summary>
        /// <param name="flightno"></param>
        /// <param name="bunk"></param>
        /// <returns></returns>

        static public string getRebateFromPolicyXml(string flightno, string bunk)
        {
            string      xmlstring = GlobalVar2.xmlPolicies;
            XmlDocument xd        = new XmlDocument();

            try
            {
                xd.LoadXml(xmlstring);
                XmlNode xn = xd.SelectSingleNode("eg").SelectSingleNode("Promots");
                for (int i = 0; i < xn.ChildNodes.Count; i++)
                {
                    try
                    {
                        ListPolicy.PolicyInfomation pi = new ListPolicy.PolicyInfomation();
                        XmlNode nodePolicy             = xn.ChildNodes[i];
                        string  strKey = nodePolicy.ChildNodes[9].ChildNodes[0].Value.ToString().Trim();
                        pi.policyid    = nodePolicy.ChildNodes[0].ChildNodes[0].Value.ToString().Trim();
                        pi.airgain     = nodePolicy.ChildNodes[1].ChildNodes[0].Value.ToString().Trim();
                        pi.gainid      = nodePolicy.ChildNodes[2].ChildNodes[0].Value.ToString().Trim();
                        pi.rebate      = nodePolicy.ChildNodes[3].ChildNodes[0].Value.ToString().Trim();
                        pi.usergain    = nodePolicy.ChildNodes[4].ChildNodes[0].Value.ToString().Trim();
                        pi.bunk        = nodePolicy.ChildNodes[5].ChildNodes[0].Value.ToString().Trim();
                        pi.agentid     = nodePolicy.ChildNodes[6].ChildNodes[0].Value.ToString().Trim();
                        pi.agentname   = nodePolicy.ChildNodes[7].ChildNodes[0].Value.ToString().Trim();
                        pi.pubusername = nodePolicy.ChildNodes[8].ChildNodes[0].Value.ToString().Trim();
                        pi.outergain   = nodePolicy.ChildNodes[10].ChildNodes[0].Value.ToString().Trim();
                        pi.policybegin = nodePolicy.ChildNodes[11].ChildNodes[0].Value.ToString().Trim();
                        pi.policyend   = nodePolicy.ChildNodes[12].ChildNodes[0].Value.ToString().Trim();

                        if (strKey.ToUpper() == flightno + "-" + bunk)
                        {
                            return(pi.rebate + "~" + pi.usergain);
                        }
                    }
                    catch
                    { }
                }
            }
            catch { }
            return("");
        }