You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
3.2 KiB
98 lines
3.2 KiB
using DyeingComputer.UserClass;
|
|
using DyeingComputer.Windows;
|
|
using formula_manage.UserClass;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Animation;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
using static DyeingComputer.UserClass.SqliteHelper;
|
|
|
|
namespace DyeingComputer.View
|
|
{
|
|
/// <summary>
|
|
/// ProgramgroupView.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class ProgramstepsView : UserControl
|
|
{
|
|
public ProgramstepsView()
|
|
{
|
|
InitializeComponent();
|
|
|
|
ProgramID = ProgramgroupView.Programgroup_ID;
|
|
ProgramNAME = ProgramgroupView.Programgroup_Numder;
|
|
this.p_title.Text = ProgramNAME;
|
|
|
|
Programgroup_sql();
|
|
}
|
|
|
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
|
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
|
DataSet sql; //内存数据缓存
|
|
|
|
string ProgramID;
|
|
string ProgramNAME;
|
|
|
|
public void Programgroup_sql()
|
|
{
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
string sql_script = "select * from ProgramSteps where ProgramID='"+ ProgramID + "' order by Step desc";
|
|
|
|
if (sql != null) sql.Clear(); //清空缓存
|
|
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表写入缓存
|
|
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
//sql.Clear(); //清除缓存
|
|
//System.GC.Collect();
|
|
}
|
|
|
|
string Numder = null;
|
|
string ID = null;
|
|
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
|
|
{
|
|
int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
{
|
|
ID = (Grid.Columns[0].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
Numder = (Grid.Columns[1].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列,
|
|
}
|
|
}
|
|
|
|
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)//
|
|
{
|
|
|
|
}
|
|
private void ProgramgroupView_Quit_Click(object sender, RoutedEventArgs e)//
|
|
{
|
|
this.Visibility = Visibility.Collapsed;//隐藏控件
|
|
}
|
|
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//
|
|
{
|
|
|
|
}
|
|
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//
|
|
{
|
|
|
|
}
|
|
private void ProgramgroupView_Save_Click(object sender, RoutedEventArgs e)//
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|
|
|