输送中心添加手动页面状态信息页面设备信息卡
This commit is contained in:
commit
acd37a8245
21 files changed
+610
-31
No files matched your search
@@ -0,0 +1,64 @@
|
||||
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.EX.DispenseState"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.EX"
|
||||
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
|
||||
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<DataGrid x:Name="Grid_data" AlternationCount="2" IsReadOnly="True" d:ItemsSource="{d:SampleData ItemCount=99}"
|
||||
Background="White" HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9"
|
||||
GridLinesVisibility="All" ColumnHeaderHeight="40"
|
||||
Grid.ColumnSpan="2" CanUserResizeRows="False" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column" SelectionMode="Single" BorderBrush="#FFC9C9C9" FontSize="16" BorderThickness="5,5,5,5" >
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="Height" Value="25" />
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
<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>
|
||||
<Trigger Property="IsMouseOver" Value="False"/>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="MinWidth" Value="20"/>
|
||||
<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.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ID}" Binding="{Binding ID}" Width="80" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Machine}" Binding="{Binding Machine}" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Dyelot}" Binding="{Binding Dyelot}" Width="200" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Redye}" Binding="{Binding ReDye}" Width="80" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding StepNumber}" Width="80" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Time}" Binding="{Binding CreationTime}" Width="200" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ProductCode}" Binding="{Binding ProductCode}" Width="200" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ProductName}" Binding="{Binding ProductName}" Width="200" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Grams}" Binding="{Binding Weight}" Width="200" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Binding="{Binding State}" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Volume}" Binding="{Binding Volume}" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.DispenseModule}" Binding="{Binding DispenseModule}" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.StartTime}" Binding="{Binding DispenseStartTime}" Width="200" IsReadOnly="True" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// DispenseState.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<Window x:Class="SunlightCentralizedControlManagement_SCCM_.EX.ManualDyelot"
|
||||
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_.EX"
|
||||
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
|
||||
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel"
|
||||
mc:Ignorable="d" ResizeMode="NoResize" WindowStyle="None" WindowStartupLocation="CenterScreen"
|
||||
Title="ManualDyelot" Height="960" Width="1280">
|
||||
<Grid Background="#FFC9C9C9">
|
||||
<Grid Margin="5,5,5,5" Background="White">
|
||||
<DataGrid x:Name="Grid_data" AlternationCount="2" IsReadOnly="True" d:ItemsSource="{d:SampleData ItemCount=99}"
|
||||
Background="White" HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9"
|
||||
GridLinesVisibility="All" ColumnHeaderHeight="50"
|
||||
Grid.ColumnSpan="2" CanUserResizeRows="False" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column" SelectionMode="Single" FontSize="20" Margin="0,0,400,0">
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="Height" Value="55" />
|
||||
<Setter Property="FontSize" Value="35" />
|
||||
<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>
|
||||
<Trigger Property="IsMouseOver" Value="False"/>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="MinWidth" Value="20"/>
|
||||
<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.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ProductCode}" Binding="{Binding ProductCode}" Width="300" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ProductName}" Binding="{Binding ProductName}" Width="300" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="KG" Binding="{Binding Weight}" Width="*" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button x:Name="State" Content="{x:Static lang:Resources.YES}" HorizontalAlignment="Right" Height="55" Margin="0,0,15,10" VerticalAlignment="Bottom" Width="200" Click="State_Click" Padding="0,4,0,4" FontSize="20"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,66 @@
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user