添加信息播报页面
This commit is contained in:
commit
8d5631a651
6 files changed
+159
-3
No files matched your search
@@ -0,0 +1,20 @@
|
|||||||
|
[2025-07-24 21:48:12];[Error] ||
|
||||||
|
|
||||||
|
[2025-07-24 21:48:12];[Error source] ||.Net SqlClient Data Provider
|
||||||
|
|
||||||
|
[2025-07-24 21:48:12];[Error message] ||在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - 无法打开到 SQL Server 的连接)
|
||||||
|
|
||||||
|
[2025-07-24 21:48:12];[Error area] || 在 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
|
||||||
|
在 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
|
||||||
|
在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
|
||||||
|
在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
|
||||||
|
在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
|
||||||
|
在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
|
||||||
|
在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
|
||||||
|
在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
|
||||||
|
在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
|
||||||
|
在 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
|
||||||
|
在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
|
||||||
|
在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
|
||||||
|
在 System.Data.SqlClient.SqlConnection.Open()
|
||||||
|
在 SunlightCentralizedControlManagement_SCCM_.ViewModel.ManualDyelotModel..ctor() 位置 C:\Users\Administrator\source\repos\SunlightCentralizedControlManagement(SCCM)\ViewModel\ManualDyelotModel.cs:行号 35
|
||||||
@@ -140,6 +140,9 @@
|
|||||||
<Compile Include="UserControls\DispenseMacInfo.xaml.cs">
|
<Compile Include="UserControls\DispenseMacInfo.xaml.cs">
|
||||||
<DependentUpon>DispenseMacInfo.xaml</DependentUpon>
|
<DependentUpon>DispenseMacInfo.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="WindowsView\UserInformation.xaml.cs">
|
||||||
|
<DependentUpon>UserInformation.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="ViewModel\CurveTempModel.cs" />
|
<Compile Include="ViewModel\CurveTempModel.cs" />
|
||||||
<Compile Include="ViewModel\CurveDiagramViewModel.cs" />
|
<Compile Include="ViewModel\CurveDiagramViewModel.cs" />
|
||||||
<Compile Include="ViewModel\MainWindowViewModel.cs" />
|
<Compile Include="ViewModel\MainWindowViewModel.cs" />
|
||||||
@@ -268,6 +271,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="WindowsView\UserInformation.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="View\CurveTemp.xaml">
|
<Page Include="View\CurveTemp.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
IsInteractive = false;
|
IsInteractive = false;
|
||||||
DATA_view();
|
DATA_view();
|
||||||
|
|
||||||
|
UserInformation userInformation = new UserInformation();
|
||||||
|
userInformation.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string machine;
|
private string machine;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
public static UserControls.info[] inf = new UserControls.info[999]; //定义总览信息卡
|
public static UserControls.info[] inf = new UserControls.info[999]; //定义总览信息卡
|
||||||
public static int ERR_c = 0;//错误计数器
|
public static int ERR_c = 0;//错误计数器
|
||||||
public static bool[] USER_Capacity { set; get; } = new bool[99];
|
public static bool[] USER_Capacity { set; get; } = new bool[99];
|
||||||
private SpeechSynthesizer synth = new SpeechSynthesizer();//语音
|
// private SpeechSynthesizer synth = new SpeechSynthesizer();//语音
|
||||||
|
|
||||||
public MainWindowViewModel()
|
public MainWindowViewModel()
|
||||||
{
|
{
|
||||||
@@ -91,8 +91,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
SN_KEY = Configini.IniReadvalue("SN", "SN1");
|
SN_KEY = Configini.IniReadvalue("SN", "SN1");
|
||||||
DyelotsDispenser = Convert.ToBoolean(Configini.IniReadvalue("SYS", "DyelotsDispenser"));
|
DyelotsDispenser = Convert.ToBoolean(Configini.IniReadvalue("SYS", "DyelotsDispenser"));
|
||||||
|
|
||||||
synth.Rate = int.Parse( Configini.IniReadvalue("VOICE", "V1"));
|
// synth.Rate = int.Parse( Configini.IniReadvalue("VOICE", "V1"));
|
||||||
synth.Volume = int.Parse( Configini.IniReadvalue("VOICE", "V2"));
|
// synth.Volume = int.Parse( Configini.IniReadvalue("VOICE", "V2"));
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex) { LogGing.ERRDATA(ex); }
|
catch (Exception ex) { LogGing.ERRDATA(ex); }
|
||||||
|
|
||||||
@@ -108,6 +109,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
CountDown();
|
CountDown();
|
||||||
TcpClientNEW();
|
TcpClientNEW();
|
||||||
SQL_LINK();
|
SQL_LINK();
|
||||||
|
|
||||||
}
|
}
|
||||||
public static void USERCapacity(string user) //权限
|
public static void USERCapacity(string user) //权限
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<Window x:Class="SunlightCentralizedControlManagement_SCCM_.WindowsView.UserInformation"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_"
|
||||||
|
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="UserInformation" Height="450" Width="800">
|
||||||
|
<Grid>
|
||||||
|
<DataGrid x:Name="Griddata" AlternationCount="2" IsReadOnly="True"
|
||||||
|
d:ItemsSource="{d:SampleData ItemCount=30}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
|
Background="White" GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right"
|
||||||
|
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||||
|
CanUserDeleteRows="False" SelectionMode="Single" FontSize="15" Focusable="True" >
|
||||||
|
<DataGrid.RowStyle >
|
||||||
|
<Style TargetType="{x:Type DataGridRow}">
|
||||||
|
<Setter Property="Height" Value="30" />
|
||||||
|
<Setter Property="FontSize" Value="25" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
||||||
|
<Setter Property="Background" Value="#FFFFFFFF" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
||||||
|
<Setter Property="Background" Value="#FFF0F0F0" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.RowStyle>
|
||||||
|
<DataGrid.CellStyle>
|
||||||
|
<Style TargetType="DataGridCell">
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="MinWidth" Value="20"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsSelected" Value="True">
|
||||||
|
<Setter Property="Background" Value="#FFC0C0C0"/>
|
||||||
|
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
|
||||||
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.CellStyle>
|
||||||
|
<DataGrid.Resources>
|
||||||
|
<Style x:Key="CellStyle" TargetType="{x:Type DataGridCell}">
|
||||||
|
<Setter Property="Focusable" Value="False"/>
|
||||||
|
<Setter Property="Background" Value="#FFFFFFFF"/>
|
||||||
|
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
|
||||||
|
<Setter Property="Foreground" Value="#000000"/>
|
||||||
|
</Style>
|
||||||
|
<DataTemplate x:Key="btnCell">
|
||||||
|
<!--注意此处的设置方式-->
|
||||||
|
<Button Content="{x:Static lang:Resources.Confirm}" Click="Button_Click" Tag="{Binding}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGrid.Resources>
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<!--列信息绑定-->
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Machine}" Binding="{Binding Machine}" Width="150" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Information}" Binding="{Binding Code}" MaxWidth="0" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Information}" Binding="{Binding ID}" MaxWidth="0" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Information}" Binding="{Binding inf}" Width="*" IsReadOnly="True"/>
|
||||||
|
<DataGridTemplateColumn Width="100" CellTemplate="{StaticResource btnCell}" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
|
||||||
|
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.Shapes;
|
||||||
|
|
||||||
|
namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// UserInformation.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class UserInformation : Window
|
||||||
|
{
|
||||||
|
DataTable dataTable = new DataTable();
|
||||||
|
public UserInformation()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
//DataTable dataTable = new DataTable();
|
||||||
|
dataTable.Columns.Add("Machine",Type.GetType("System.String"));
|
||||||
|
dataTable.Columns.Add("Information", Type.GetType("System.String"));
|
||||||
|
dataTable.Columns.Add("Code", Type.GetType("System.String"));
|
||||||
|
dataTable.Columns.Add("ID", Type.GetType("System.Int32"));
|
||||||
|
dataTable.Rows.Add(new object[] { "1", "a","423","12"});
|
||||||
|
dataTable.Rows.Add(new object[] { "2", "b" ,"345","122"});
|
||||||
|
dataTable.Rows.Add(new object[] { "3", "c" ,"345","32"});
|
||||||
|
dataTable.Rows.Add(new object[] { "1", "a", "423", "1232" });
|
||||||
|
dataTable.Rows.Add(new object[] { "2", "b", "345", "1222" });
|
||||||
|
dataTable.Rows.Add(new object[] { "3", "c", "345", "325" });
|
||||||
|
|
||||||
|
Griddata.ItemsSource = dataTable.DefaultView;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var button = sender as Button;
|
||||||
|
DataRowView datarow = (DataRowView)button.Tag;
|
||||||
|
var y= datarow.Row.Field<int>("ID");
|
||||||
|
DataRow erwqer = dataTable.Select("ID='" + y + "'").First();
|
||||||
|
|
||||||
|
erwqer.Delete();
|
||||||
|
Griddata.ItemsSource = dataTable.DefaultView;
|
||||||
|
|
||||||
|
if (dataTable.Rows.Count == 0) { this.Close(); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user