Example #1
0
        /// <summary>
        /// 资源编录列表-完税信息
        /// </summary>
        public void GetHtmlSourceListWS()
        {
            ConvertWS convertWS = new ConvertWS();
            int       pageNum   = 1;

            while (true)
            {
                string   strTargerUrl = string.Format("http://resource.autoidc.cn/pages/list.aspx?RESOURCEKEY=WS&PAGEID={0}", pageNum);
                string   strContex    = ReadHTML(strTargerUrl);
                var      num          = convertWS.getPageNumHGZ(strContex);
                var      data         = convertWS.getListWS(strContex);
                InsertWS insertWS     = new InsertWS();
                //insertWS.InsertDBWS(data);
                //insertWS.InsertSingleDBWS(data);
                insertWS.InsertTvpDBWS(data);
                LogManager.Log("MainLog", "WS", pageNum.ToString());
                //for (int i = 0; i < data.Rows.Count; i++)
                //{
                //    // 资源明细-机动车合格证申请界面
                //    string strTargerUrlDetailsWS = string.Format("http://resource.autoidc.cn/pages/details.aspx?RESOURCEKEY=WS&RESOURCEID={0}", data.Rows[i]["RESOURCE_ID"]);
                //    GetHtmlSourceDetailsWS(data.Rows[i]["RESOURCE_ID"].ToString(), strTargerUrlDetailsWS);
                //    LogManager.Log("MainLog", "WS", data.Rows[i]["RESOURCE_ID"].ToString());
                //}
                pageNum++;
                if (num == pageNum)
                {
                    break;
                }
            }
        }
Example #2
0
        /// <summary>
        /// 完税信息-详细信息
        /// </summary>
        public void GetHtmlSourceDetailsWS(string resourceId, string strTargerUrl)
        {
            string    strContex = ReadHTML(strTargerUrl);
            ConvertWS convertWS = new ConvertWS();
            var       data      = convertWS.getDetailsWS(resourceId, strContex);
            InsertWS  insertWS  = new InsertWS();

            //insertWS.InsertDetailsWS(data);
            insertWS.InsertDBWS(data);
            //insertWS.InsertSingleDBWS(data);
        }
Example #3
0
        /// <summary>
        /// 插入数据库
        /// </summary>
        /// <param name="strLoginUrl"></param>
        /// <param name="strTargerUrl"></param>
        /// <param name="data">列表数据</param>
        public void InsertDataWS(string strLoginUrl, string strTargerUrl, DataTable data)
        {
            string msg = string.Empty;

            try
            {
                string   strContex = string.Empty;
                int      dataCount = data.Rows.Count;
                InsertWS insertWS  = new InsertWS();
                insertWS.InsertDBWS(data);
                msg = string.Format("{0} 完税信息数据 插入列表{1}条数据", DateTime.Now.ToString("G"), dataCount.ToString());
                LogWrite(msg);
            }
            catch (ArgumentException ex)
            {
                msg = string.Format("{0} 插入合格证详细信息,出错:{1}", DateTime.Now.ToString("G"), ex.Message);
                LogWrite(msg);
            }
        }