Ejemplo n.º 1
0
 public static void Analysis(string content, string date)
 {
     if ((content.Contains("尾号") || content.Contains("信用卡")) && content.Contains("消费人民币"))
     {
         string shortNumber = null;
         if (content.Contains("民生银行"))
         {
             shortNumber = content.Substring(content.IndexOf("信用卡") + 3, 4);
         }
         else
         {
             shortNumber = content.Substring(content.IndexOf("尾号") + 2, 4);
         }
         //Console.WriteLine("尾号:{0}", weihao);
         string  xiaofei = content.Substring(content.IndexOf("消费人民币") + 5);
         decimal cost    = isnumeric(xiaofei);
         string  bank    = BankName(content);
         if (bank != "")
         {
             //Console.WriteLine("消费金额:{0}", cost);
             //Console.WriteLine("银行:{0}", type(content));
             var model = new Bill()
             {
                 AddTime     = TimeHelper.ConvertStringToDateTime(date),
                 CostDate    = date,
                 ShortNumber = shortNumber,
                 BankType    = bank,
                 Money       = cost,
                 Content     = content
             };
             var b = billDAL.Add(model);
             if (smsCount <= 10 && b)
             {
                 MessageList.BillList.Insert(0, model);
                 smsCount++;
             }
         }
     }
     else
     {
         //  Console.WriteLine("短信消息没有包含的关键字");
     }
 }
Ejemplo n.º 2
0
 public int Add(Bill obj)
 {
     return(billDAL.Add(obj));
 }