public Form1(JdUnion_GoodsDataLoadClass jdc) { InitializeComponent(); try { if (jdc == null) { jdc = new JdUnion_GoodsDataLoadClass(); } if (!Program.WCS_Inited) { GlobalShare.MainAssem = Assembly.GetExecutingAssembly(); GlobalShare.AppDllPath = Application.StartupPath; GlobalShare.Init(Application.StartupPath); Program.ForceLogin(); } } catch (Exception ce) { jdc.UpdateText(ce.Message); return; } currJdc = jdc; bool inited = JdUnion_GlbObject.Inited; //JdGoodsQueryClass.LoadAllcommissionGoods = loadAllData; downloadTimer = new System.Windows.Forms.Timer(); downloadTimer.Interval = 6 * 60 * 60 * 1000;//6小时 downloadTimer.Tick += DownloadTimer_Tick; downloadTimer.Enabled = false; jdc.UpdateText?.Invoke("京东数据接受模块界面加载成功!"); }
private void btn_recieveData_Click(object sender, EventArgs e) { try { if (currJdc == null) { currJdc = new JdUnion_GoodsDataLoadClass(); } this.downloadTimer.Enabled = true; currJdc.onReceiveData = loadEliteData; currJdc.SaveClientData = SaveClientData; //保存单批数据 currJdc.onSavedData = updateGlobalQueryData; //保存完数据处理,更新globalqueryobject this.DownloadTimer_Tick(null, null); } catch (Exception ce) { currJdc.UpdateText(string.Format("接收数据出现未知错误:{0}", ce.Message)); } }