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.
67 lines
2.2 KiB
67 lines
2.2 KiB
7 months ago
|
using SunlightCentralizedControlManagement_SCCM_.UserClass;
|
||
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Data.SqlClient;
|
||
|
using System.Data;
|
||
|
using System.Linq;
|
||
|
using System.Security.Cryptography;
|
||
|
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.Shapes;
|
||
|
|
||
|
namespace SunlightCentralizedControlManagement_SCCM_.EX
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// ManualDyelot.xaml 的交互逻辑
|
||
|
/// </summary>
|
||
|
public partial class ManualDyelot : Window
|
||
|
{
|
||
|
public ManualDyelot()
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
}
|
||
|
public async void MAC(object Machines)
|
||
|
{
|
||
|
string Connstr_SC;
|
||
|
string sql = "SELECT * FROM [dbo].[Pipes] WHERE Dispenser = '" + Machines + "'";
|
||
|
|
||
|
try
|
||
|
{
|
||
|
if (MainWindowViewModel.SQMOD == "Windows Authentication")
|
||
|
{
|
||
|
Connstr_SC = "server=" + MainWindowViewModel.SQLIP + ";database=" + MainWindowViewModel.SQLNAME + ";Trusted_Connection=SSPI";
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Connstr_SC = "server=" + MainWindowViewModel.SQLIP + ";database=" + MainWindowViewModel.SQLNAME + ";User ID=" + MainWindowViewModel.SQLUSER + ";Password=" + MainWindowViewModel.SQLPASWORD;
|
||
|
}
|
||
|
SqlConnection conn_SC = new SqlConnection(Connstr_SC);
|
||
|
await conn_SC.OpenAsync(); //连接数据库
|
||
|
SqlDataAdapter _data = new SqlDataAdapter(sql, Connstr_SC); //查询
|
||
|
conn_SC.Close();
|
||
|
|
||
|
DataTable ds = new DataTable();//载入信息
|
||
|
_data.Fill(ds);
|
||
|
Grid_data.ItemsSource = ds.DefaultView;
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
LogGing.ERRDATA(ex);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void State_Click(object sender, RoutedEventArgs e)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|