Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
b373c452c0
3 files changed
+22
-4
No files matched your search
@@ -75,7 +75,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">
|
<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" >
|
<StackPanel Orientation="Horizontal" >
|
||||||
<materialDesign:PackIcon Kind="MoonNew" Width="40" Height="30" Margin="10" VerticalAlignment="Center" Foreground="#FF1368BD"/>
|
<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"/>
|
<TextBlock Text="{x:Static lang:Resources.Plan}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>
|
||||||
|
|||||||
@@ -216,6 +216,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
else
|
else
|
||||||
return new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Transparent);
|
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)//新建事件
|
private void ListViewItem_New(object sender, System.Windows.Input.MouseButtonEventArgs e)//新建事件
|
||||||
{
|
{
|
||||||
Picture.Content = null;
|
Picture.Content = null;
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Programgroup_sql();
|
Programgroup_sql();
|
||||||
|
|
||||||
string[] group_data = { "en-US", "zh-CN", "zh-TW" };
|
Group.Text = "ALL";
|
||||||
Group.ItemsSource = group_data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||||
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
||||||
DataSet sql; //内存数据缓存
|
DataSet sql; //内存数据缓存
|
||||||
|
string[] group_data;
|
||||||
|
|
||||||
public void Programgroup_sql()
|
public void Programgroup_sql()
|
||||||
{
|
{
|
||||||
@@ -32,11 +32,21 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
SQLiteHelpers.Open(); //打开数据库
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
|
||||||
string sql_script = "select * from ProgramName order by ProgramID desc";
|
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(); //清空缓存
|
if (sql != null) sql.Clear(); //清空缓存
|
||||||
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表写入缓存
|
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表写入缓存
|
||||||
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
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(); //关闭连接
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,6 +139,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
string VALUE = frm.InputValue;
|
string VALUE = frm.InputValue;
|
||||||
Dictionary<string, object> Program_Rename = new Dictionary<string, object>();//缓存函数
|
Dictionary<string, object> Program_Rename = new Dictionary<string, object>();//缓存函数
|
||||||
Program_Rename.Add("ProgramName", VALUE);
|
Program_Rename.Add("ProgramName", VALUE);
|
||||||
|
Program_Rename.Add("Groups", Group.Text);
|
||||||
|
|
||||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
SQLiteHelpers.Open(); //打开数据库
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
@@ -185,6 +196,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
SQLiteHelpers.Open(); //打开数据库
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
SQLiteHelpers.Delete("ProgramName", "ProgramID='" + Programgroup_ID + "'", null);
|
SQLiteHelpers.Delete("ProgramName", "ProgramID='" + Programgroup_ID + "'", null);
|
||||||
|
SQLiteHelpers.Delete("ProgramSteps", "ProgramID='" + Programgroup_ID + "'", null);
|
||||||
SQLiteHelpers.Close();
|
SQLiteHelpers.Close();
|
||||||
Programgroup_sql();
|
Programgroup_sql();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user