示例#1
0
        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();
            }
        }