diff --git a/ConvertMoels/StateToColorConvert.cs b/ConvertMoels/StateToColorConvert.cs index 08683c8..0fdad06 100644 --- a/ConvertMoels/StateToColorConvert.cs +++ b/ConvertMoels/StateToColorConvert.cs @@ -24,6 +24,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels if (i == "201") return "green"; else if (i == "202") return "yellow"; else if (i == "309") return "Red"; + else if (i == "800") return "Red"; else return "block"; } } diff --git a/ConvertMoels/StatenClassConvert.cs b/ConvertMoels/StatenClassConvert.cs index 9460b1a..53fa01b 100644 --- a/ConvertMoels/StatenClassConvert.cs +++ b/ConvertMoels/StatenClassConvert.cs @@ -35,7 +35,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels else if (i == "309") Staten = Properties.Resources.Abnormal;//错误 else if (i == "800") Staten = Properties.Resources.Notimplementation;//未连接 else if (i == "801") Staten = Properties.Resources.Implementation;//连接成功 - else if (i == "801") Staten = Properties.Resources.Online;//在线 + else if (i == "802") Staten = Properties.Resources.Online;//在线 else if (i == "899") Staten = Properties.Resources.CloseTheConnection;//关闭连接 else Staten = "null"; diff --git a/EX/DispenseState.xaml b/EX/DispenseState.xaml new file mode 100644 index 0000000..45dc445 --- /dev/null +++ b/EX/DispenseState.xaml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EX/DispenseState.xaml.cs b/EX/DispenseState.xaml.cs new file mode 100644 index 0000000..299ba5b --- /dev/null +++ b/EX/DispenseState.xaml.cs @@ -0,0 +1,69 @@ +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.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; + +namespace SunlightCentralizedControlManagement_SCCM_.EX +{ + /// + /// DispenseState.xaml 的交互逻辑 + /// + public partial class DispenseState : UserControl + { + public DispenseState() + { + InitializeComponent(); + } + public async void State(object dat,string mac) + { + string Connstr_SC; + string WaitChemical_WaitDispenseDyestuff; + string DAT = mac.Substring(0,3); + if (DAT == "252") + { + WaitChemical_WaitDispenseDyestuff = "SELECT * FROM [dbo].[WaitDispenseDyestuff] WHERE DispenseMachine = '" + dat + "'"; + } + else + { + WaitChemical_WaitDispenseDyestuff = "SELECT * FROM [dbo].[WaitChemical] WHERE DispenseMachine = '" + dat + "'"; + } + 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 WaitChemical_data = new SqlDataAdapter(WaitChemical_WaitDispenseDyestuff, Connstr_SC); //查询 + conn_SC.Close(); + + DataTable ds = new DataTable();//载入信息 + WaitChemical_data.Fill(ds); + Grid_data.ItemsSource = ds.DefaultView; + } + catch (Exception ex) + { + LogGing.ERRDATA(ex); + } + } + } +} diff --git a/EX/ManualDyelot.xaml b/EX/ManualDyelot.xaml new file mode 100644 index 0000000..5df430a --- /dev/null +++ b/EX/ManualDyelot.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + +