public string Create(HptJobInfo job) { ErrorState = false; try { var postcontent = "{\"publisher\": \"twitter\",\"streamType\": \"track\",\"dataFormat\": \"activity_streams\",\"fromDate\": \"201501200000\",\"toDate\": \"201501210000\",\"title\": \"historicalJob1\",\"rules\":[{\"tag\":\"test\",\"value\":\"interpress\"}]}"; var jsonResponse = ""; var responseCode = Utilities.Restful.GetRestResponse( "POST", jobStatusURL(), Username, Password, out jsonResponse, postcontent); if (responseCode == HttpStatusCode.OK) { var JobObject = JsonConvert.DeserializeObject <HptJobInfo>(jsonResponse); } } catch (Exception ex) { } return(null); }
private void UpdateJob(string uuid, int RowId, string toStatus) { Debug.WriteLine("uuid:" + uuid); tsMessage.Text = "Updating Job " + dgvHPTJobs.Rows[RowId].Cells["title"].Value; HptJobInfo jobInfo = null; if (toStatus == "Accept") { jobInfo = hptJob.Accept(uuid); } else { jobInfo = hptJob.Reject(uuid); } if (jobInfo == null) { if (hptJob.ErrorState) { MessageBox.Show( hptJob.ErrorMessage, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Job updated: " + jobInfo.statusMessage, Text, MessageBoxButtons.OK, MessageBoxIcon.Information); GetJobs(); } }
public string Create(HptJobInfo job) { ErrorState = false; return(null); }