public void LoadUploadRecord() { Task.Factory.StartNew(() => { SearchNotifyRequest request = new SearchNotifyRequest(); string responseContent = CoreHelper.DoPost(System.Configuration.ConfigurationManager.AppSettings["PolicyNotifyUrl"].ToString(), request); if (string.IsNullOrEmpty(responseContent)) { // MessageBox.Show("未找到任何上传记录"); return; } SearchNotifyResponse rep = JsonConvert.DeserializeObject <SearchNotifyResponse>(responseContent); if (rep.ErrCode == ResultType.Failed) { // MessageBox.Show(rep.ErrMsg); return; } DataTable dt = ListToDataTableWithRec(rep.NotifyList); ShowUploadRecord(dt); //this.Invoke(showUploadRecord, dt); //AddDataAction = new Action(() => //{ //this.dataGridView2.DataSource = dt; // }); }); }
private bool SearchNotifyStatus(string uploadStatusId) { SearchNotifyRequest request = new SearchNotifyRequest() { UploadStatusId = uploadStatusId }; string responseContent = CoreHelper.DoPost(System.Configuration.ConfigurationManager.AppSettings["PolicyNotifyUrl"].ToString(), request); SearchNotifyResponse rep = JsonConvert.DeserializeObject <SearchNotifyResponse>(responseContent); if (rep.ErrCode == ResultType.Failed) { return(true); } else { if (rep.NotifyList[0].NotifyResult == 1 || rep.NotifyList[0].NotifyResult == 2) { return(true); } else { return(false); } } }