sc 8 months ago
parent
commit
b373c452c0
  1. 2
      View/ProductionPlanningView.xaml
  2. 6
      View/ProductionPlanningView.xaml.cs
  3. 18
      View/ProgramgroupView.xaml.cs

2
View/ProductionPlanningView.xaml

@ -75,7 +75,7 @@
</StackPanel>
<StackPanel Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal" HorizontalAlignment="Right">
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">
<ListViewItem Width="150" MouseLeftButtonUp="ListViewItem_New" IsEnabled="{Binding USER_Capacity[5]}">
<ListViewItem Width="150" MouseLeftButtonUp="ListViewItem_Plan" IsEnabled="{Binding USER_Capacity[5]}">
<StackPanel Orientation="Horizontal" >
<materialDesign:PackIcon Kind="MoonNew" Width="40" Height="30" Margin="10" VerticalAlignment="Center" Foreground="#FF1368BD"/>
<TextBlock Text="{x:Static lang:Resources.Plan}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>

6
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;

18
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<string> result = new List<string>();
result.Add("ALL");
for (int i =0; i<GROUP.Rows.Count;i++)
{
result.Add (GROUP.Rows[i][1].ToString());
}
Group.ItemsSource = result.ToArray();
SQLiteHelpers.Close(); //关闭连接
}
@ -129,6 +139,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
string VALUE = frm.InputValue;
Dictionary<string, object> Program_Rename = new Dictionary<string, object>();//缓存函数
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();
}

Loading…
Cancel
Save