diff --git a/View/ProductionPlanningView.xaml b/View/ProductionPlanningView.xaml index 838ba58..44e4985 100644 --- a/View/ProductionPlanningView.xaml +++ b/View/ProductionPlanningView.xaml @@ -75,7 +75,7 @@ - + diff --git a/View/ProductionPlanningView.xaml.cs b/View/ProductionPlanningView.xaml.cs index 27b53a4..eee385c 100644 --- a/View/ProductionPlanningView.xaml.cs +++ b/View/ProductionPlanningView.xaml.cs @@ -216,6 +216,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View else return new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Transparent); } + private void ListViewItem_Plan(object sender, System.Windows.Input.MouseButtonEventArgs e)//计划事件 + { + Picture.Content = null; + Picture.Width = 600; + Picture.Content = new ProductionPlanningEdit(null, true); + } private void ListViewItem_New(object sender, System.Windows.Input.MouseButtonEventArgs e)//新建事件 { Picture.Content = null; diff --git a/View/ProgramgroupView.xaml.cs b/View/ProgramgroupView.xaml.cs index 82e5ad6..83afed1 100644 --- a/View/ProgramgroupView.xaml.cs +++ b/View/ProgramgroupView.xaml.cs @@ -17,14 +17,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.View { InitializeComponent(); Programgroup_sql(); - - string[] group_data = { "en-US", "zh-CN", "zh-TW" }; - Group.ItemsSource = group_data; + + Group.Text = "ALL"; } private SQLiteHelper SQLiteHelpers = null; //定义数据库 private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径 DataSet sql; //内存数据缓存 + string[] group_data; public void Programgroup_sql() { @@ -32,11 +32,21 @@ namespace SunlightCentralizedControlManagement_SCCM_.View SQLiteHelpers.Open(); //打开数据库 string sql_script = "select * from ProgramName order by ProgramID desc"; + string sql_ProgramGroup = "select * from ProgramGroup order by ID desc"; if (sql != null) sql.Clear(); //清空缓存 sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表写入缓存 if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表 + DataTable GROUP = SQLiteHelpers.ExecuteDataSet(sql_ProgramGroup, null).Tables[0]; //获得程序组 + List result = new List(); + result.Add("ALL"); + for (int i =0; i Program_Rename = new Dictionary();//缓存函数 Program_Rename.Add("ProgramName", VALUE); + Program_Rename.Add("Groups", Group.Text); SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers.Open(); //打开数据库 @@ -185,6 +196,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers.Open(); //打开数据库 SQLiteHelpers.Delete("ProgramName", "ProgramID='" + Programgroup_ID + "'", null); + SQLiteHelpers.Delete("ProgramSteps", "ProgramID='" + Programgroup_ID + "'", null); SQLiteHelpers.Close(); Programgroup_sql(); }