diff --git a/View/ProductionPlanningView.xaml.cs b/View/ProductionPlanningView.xaml.cs index 11ddd6d..3fdb490 100644 --- a/View/ProductionPlanningView.xaml.cs +++ b/View/ProductionPlanningView.xaml.cs @@ -121,9 +121,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.View { MessageBox.Show("Edit clicked for task " + ganttTask.Name); } - private void DeleteClicked(GanttTask ganttTask) + private void DeleteClicked(GanttTask ganttTask)//删除 { - MessageBox.Show("Delete clicked for task " + ganttTask.Name); + SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 + SQLiteHelpers.Open(); //打开数据库 + SQLiteHelpers.Delete( + "WorkOrder", "StartTime='" + ganttTask.Start + "'and EndTime='"+ ganttTask .End+ "'", null); + SQLiteHelpers.Close(); + GanttChartNEW(); } private string FormatYear(Period period) {