using DyeingComputer.UserClass; using SunlightCentralizedControlManagement_SCCM_.UserClass; using SunlightCentralizedControlManagement_SCCM_.ViewModel; 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.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Threading; using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; namespace SunlightCentralizedControlManagement_SCCM_.View { /// /// Whole.xaml 的交互逻辑 /// public partial class DyelotView : UserControl { private SQLiteHelper SQLiteHelpers = null; //定义数据库 private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径 public DyelotView() { InitializeComponent(); } private void UserControl_Loaded(object sender, RoutedEventArgs e) { } public void Dyelot(object dat) { SQLiteHelpers = new SQLiteHelper(DBAddress); SQLiteHelpers.Open(); //打开数据库 DataTable dat_c = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where WorkOrder = '" + dat + "'", null).Tables[0];//缓存 SQLiteHelpers.Close(); Grid_data.ItemsSource = dat_c.DefaultView; } public void DyelotDatatable(DataTable dat) { Grid_data.ItemsSource = dat.DefaultView; } } }