Ejemplo n.º 1
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            List <WebSiteModel> sites = new List <WebSiteModel>();

            foreach (CheckedListBoxItem item in _chkList.CheckedItems)
            {
                sites.Add(new WebSiteModel()
                {
                    url = "http:" + item.Value.ToString(), title = item.Description
                });
            }
            if (sites != null && sites.Count > 0)
            {
                InitImportProcess(sites.Count);
                WareImport.GetInstance().ShowStep    = ShowImportStep;
                WareImport.GetInstance().ShowMessage = ShowImportMsg;
                WareImport.GetInstance().EndProcess  = EndImportProcess;

                Thread importThread = new Thread(delegate(){ CheckedWareImportThread(sites); })
                {
                    Name = "searchWareImport", IsBackground = true
                };
                importThread.Start();
            }
        }
Ejemplo n.º 2
0
        private void btnInport_Click(object sender, EventArgs e)
        {
            if (!File.Exists(btnOpenFile.Text))
            {
                return;
            }
            InitProcess();
            string fileName     = btnOpenFile.Text;
            Thread exportThread = new Thread(delegate() { WareImport.GetInstance().ImportWareList(fileName); })
            {
                Name = "exportThread", IsBackground = true
            };

            exportThread.Start();

            _isInport = true;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取列表中商品数据并入库
        /// </summary>
        /// <param name="sites"></param>
        private void ImportProcess4AllTypes(List <WebSiteModel> sites)
        {
            if (sites != null && sites.Count > 0)
            {
                InitProcess(sites.Count);
                WareImport.GetInstance().ShowMessage = ShowImportMsg;
                WareImport.GetInstance().ShowStep    = ShowImportStep;
                WareImport.GetInstance().EndProcess  = EndImportProcess;

                Thread exportThread = new Thread(delegate() { WareImport.GetInstance().ImportWareList(sites); })
                {
                    Name = "exportThread", IsBackground = true
                };
                exportThread.Start();

                _isImport = true;
            }
        }
Ejemplo n.º 4
0
 private void CheckedWareImportThread(List <WebSiteModel> sites)
 {
     _isImport     = true;
     _isProcessing = true;
     WareImport.GetInstance().ImportWareList(sites);
 }