Exemplo n.º 1
0
        public static List <DeductionObject> GetUserDeduction(UserObject user)
        {
            List <DeductionObject> lists = new List <DeductionObject>();

#if DEBUG
            Console.WriteLine("开始执行获取用户折扣券时间!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
#endif
            string xml = hiPiaoSrv.QueryUserDeduction(user);
#if DEBUG
            Console.WriteLine("结束执行获取用户折扣券时间!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
#endif
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);
#if DEBUG
            Console.WriteLine("加载返回结果到XmlDocument文档中!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
#endif
            XmlNodeList     deductionNodes = doc.SelectNodes("//dif");
            DeductionObject deduction;
            for (int i = 0; i < deductionNodes.Count; i++)
            {
#if DEBUG
                Console.WriteLine("初始化折扣券对象时间1!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
#endif
                deduction = new DeductionObject();

                /*
                 * deduction.Amount = Double.Parse(deductionNodes[i].Attributes["amount"].Value);
                 * deduction.CardId = deductionNodes[i].Attributes["cardId"].Value;
                 * deduction.Period = deductionNodes[i].Attributes["period"].Value;
                 * deduction.UseDate =deductionNodes[i].Attributes["useDate"]!=null? deductionNodes[i].Attributes["useDate"].Value:string.Empty;
                 * deduction.UseRule = deductionNodes[i].Attributes["useRule"].Value;
                 * deduction.Status = deductionNodes[i].Attributes["status"].Value;
                 #if DEBUG
                 * Console.WriteLine("初始化折扣券对象时间2!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                 #endif
                 * */
                lists.Add(deduction);
            }
            return(lists);
        }
Exemplo n.º 2
0
 public static List<DeductionObject> GetUserDeduction(UserObject user)
 {
     List<DeductionObject> lists = new List<DeductionObject>();
     #if DEBUG
     Console.WriteLine("开始执行获取用户折扣券时间!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
     #endif
     string xml = hiPiaoSrv.QueryUserDeduction(user);
     #if DEBUG
     Console.WriteLine("结束执行获取用户折扣券时间!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
     #endif
     XmlDocument doc = new XmlDocument();
     doc.LoadXml(xml);
     #if DEBUG
     Console.WriteLine("加载返回结果到XmlDocument文档中!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
     #endif
     XmlNodeList deductionNodes = doc.SelectNodes("//dif");
     DeductionObject deduction;
     for (int i = 0; i < deductionNodes.Count; i++)
     {
     #if DEBUG
         Console.WriteLine("初始化折扣券对象时间1!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
     #endif
         deduction = new DeductionObject();
         /*
         deduction.Amount = Double.Parse(deductionNodes[i].Attributes["amount"].Value);
         deduction.CardId = deductionNodes[i].Attributes["cardId"].Value;
         deduction.Period = deductionNodes[i].Attributes["period"].Value;
         deduction.UseDate =deductionNodes[i].Attributes["useDate"]!=null? deductionNodes[i].Attributes["useDate"].Value:string.Empty;
         deduction.UseRule = deductionNodes[i].Attributes["useRule"].Value;
         deduction.Status = deductionNodes[i].Attributes["status"].Value;
     #if DEBUG
         Console.WriteLine("初始化折扣券对象时间2!" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
     #endif
          * */
         lists.Add(deduction);
     }
     return lists;
 }