示例#1
0
 /// <summary>
 /// 取消查询任务
 /// </summary>
 private bool CancelTask()
 {
     if (this.CurrentTask != null)
     {
         using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient())
         {
             if (_msc.CancleQueryTask(this.CurrentTask.TaskID))
             {
                 XtraMessageBox.Show(string.Format("查询任务\"{0}\"记录已经被取消!", this.CurrentTask.TaskName), "系统提示",
                                     MessageBoxButtons.OK, MessageBoxIcon.Information);
                 this.gridView1.BeginUpdate();
                 this.CurrentTask.TaskState = 4;
                 this.gridView1.EndDataUpdate();
                 RaiseMenuChanged();
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
     else
     {
         return(false);
     }
 }