| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using BizCom;
- using System;
- using System.Collections.Generic;
- using System.Data;
- namespace SiteCore
- {
- public class taobaoTmcTest
- {
- private static bool isGet = false;
- public static void getInfo()
- {
- if (isGet) return;
- isGet = true;
- try
- {
- string sql = "select top 30 * from S_TaoBaoTmc2 order by id asc";
- DataTable dt = SqlHelper.ExecuteDataSet(sql).Tables[0];
- List<string> idLst = new List<string>();
- foreach (DataRow dr in dt.Rows)
- {
- idLst.Add(dr["id"].ToString());
- try
- {
- string dotype = dr["Topic"].ToString();
- if (dotype == "create")
- {
- tmcHelper.Api_TmcTradeMsg_Create(dr["message"].ToString());
- }
- else
- tmcHelper.Api_TmcTradeMsg(dr["message"].ToString());
- }
- catch (Exception ex)
- {
- XLog.SaveLog(0, dr["message"].ToString() + "------" + ex.Message);
- //tmcHelper.Api_TmcTradeMsg(dr["message"].ToString());
- }
- }
- if (idLst.Count > 0)
- {
- sql = "delete from S_TaoBaoTmc2 where id in (" + string.Join(",", idLst.ToArray()) + ") ;";
- SqlHelper.ExecuteNonQuery(sql);
- }
- }
- catch (Exception ex)
- {
- XLog.SaveLog(0, "getinfo" + ex.Message);
- }
- finally
- {
- isGet = false;
- }
- }
- }
- }
|