示例#1
0
        private void toolStripButton_TaskDelete_Click(object sender, EventArgs e)
        {
            int taskId = m_frmTaskMain.Get_DataViewID();

            if (taskId > 0)
            {
                if (MessageBox.Show("你确定要删除吗?删除不可恢复!", "警告!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
                {
                    DALTask dal = new DALTask();
                    dal.Delete(taskId);
                    m_frmTaskMain.Bind_DataList();
                }
            }
        }
示例#2
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ToolStripMenuItem_TaskDel_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("你确定要删除吗?删除不可恢复!", "警告!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
     {
         DALTask   dal      = new DALTask();
         ModelTask model    = dal.GetModel(Get_DataViewID());
         string    TaskName = model.TaskName;
         string    RootPath = AppDomain.CurrentDomain.BaseDirectory + "Data\\Collection\\";
         string    TaskPath = RootPath + TaskName;
         if (Directory.Exists(TaskPath))
         {
             Directory.Delete(TaskPath, true);
         }
         dal.Delete(Get_DataViewID());
         this.Bind_DataList();
     }
 }