21 changed files with 610 additions and 31 deletions
@ -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) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,40 @@ |
|||
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.UserControls.DispenseMacInfo" |
|||
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_.UserControls" |
|||
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties" |
|||
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel" |
|||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" |
|||
mc:Ignorable="d" |
|||
d:DesignHeight="600" d:DesignWidth="400" Background="#FF828282"> |
|||
<Grid Margin="5,5,5,5" Background="White" > |
|||
<Image x:Name="IMAGE" VerticalAlignment="Top" Height="400" Margin="0,5,0,0" /> |
|||
<Grid Margin="0,400,0,0"> |
|||
<TextBlock TextWrapping="Wrap" Text="{x:Static lang:Resources.Machine}" Height="30" VerticalAlignment="Top" FontSize="16" |
|||
HorizontalAlignment="Left" Width="150" Background="#FFE0E0E0"/> |
|||
<TextBlock TextWrapping="Wrap" Text="{x:Static lang:Resources.State}" Height="30" VerticalAlignment="Top" FontSize="16" |
|||
Margin="0,30,0,0" HorizontalAlignment="Left" Width="150" Background="#FFE0E0E0"/> |
|||
<TextBlock TextWrapping="Wrap" Text="{x:Static lang:Resources.WorkingStatus}" Height="30" VerticalAlignment="Top" FontSize="16" |
|||
Margin="0,60,0,0" HorizontalAlignment="Left" Width="150" Background="#FFE0E0E0"/> |
|||
<Border BorderBrush="#FFE0E0E0" BorderThickness="1" Height="30" VerticalAlignment="Top" Margin="150,0,80,0"> |
|||
<TextBlock x:Name="mac" TextWrapping="Wrap" Text="------" FontSize="16" /> |
|||
</Border> |
|||
<Border BorderBrush="#FFE0E0E0" BorderThickness="1" Height="30" VerticalAlignment="Top" Margin="150,0,0,0" HorizontalAlignment="Right" Width="80"> |
|||
<TextBlock x:Name="macg" TextWrapping="Wrap" Text="------" FontSize="16" /> |
|||
</Border> |
|||
<Border BorderBrush="#FFE0E0E0" BorderThickness="1" Height="30" VerticalAlignment="Top" Margin="150,30,0,0"> |
|||
<TextBlock x:Name="state" TextWrapping="Wrap" Text="------" FontSize="16" /> |
|||
</Border> |
|||
<Border BorderBrush="#FFE0E0E0" BorderThickness="1" Height="30" VerticalAlignment="Top" Margin="150,60,0,0"> |
|||
<TextBlock x:Name="WorkingStatus" TextWrapping="Wrap" Text="------" FontSize="16" /> |
|||
</Border> |
|||
<Button x:Name="State" Content="{x:Static lang:Resources.Information}" HorizontalAlignment="Right" Height="35" Margin="0,0,15,10" VerticalAlignment="Bottom" Width="80" Click="State_Click" Padding="0,4,0,4"/> |
|||
<Button x:Name="Manual" Content="{x:Static lang:Resources.Manual}" HorizontalAlignment="Right" Height="35" Margin="0,0,115,10" VerticalAlignment="Bottom" Width="80" Click="Manual_Click" Padding="0,4,0,4"/> |
|||
<Button x:Name="Screen" Content="{x:Static lang:Resources.Screen}" HorizontalAlignment="Right" Height="35" Margin="0,0,215,10" VerticalAlignment="Bottom" Width="80" Click="Screen_Click" Padding="0,4,0,4"/> |
|||
|
|||
<materialDesign:PackIcon x:Name="mlock" Kind="Lock" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="50" Height="50" Foreground="#FFA98C00" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/> |
|||
</Grid> |
|||
</Grid> |
|||
</UserControl> |
@ -0,0 +1,70 @@ |
|||
using ScottPlot.Plottables; |
|||
using SunlightCentralizedControlManagement_SCCM_.EX; |
|||
using SunlightCentralizedControlManagement_SCCM_.WindowsView; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
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.Animation; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Media.Media3D; |
|||
using System.Windows.Navigation; |
|||
using System.Windows.Shapes; |
|||
using System.Windows.Threading; |
|||
|
|||
namespace SunlightCentralizedControlManagement_SCCM_.UserControls |
|||
{ |
|||
/// <summary>
|
|||
/// info.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class DispenseMacInfo : UserControl |
|||
{ |
|||
public DispenseMacInfo() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private void State_Click(object sender, RoutedEventArgs e) |
|||
{ |
|||
if (mlock.Visibility == Visibility.Visible) |
|||
{ |
|||
MessageBox.Show(Properties.Resources.Not_a,"Dispense",MessageBoxButton.OK); |
|||
return; |
|||
} |
|||
UserMessage userMessage = new UserMessage(); |
|||
userMessage.DispenseMacInfo(mac.Text, macg.Text); |
|||
userMessage.Show(); |
|||
} |
|||
|
|||
private void Manual_Click(object sender, RoutedEventArgs e) |
|||
{ |
|||
if (mlock.Visibility == Visibility.Visible) |
|||
{ |
|||
MessageBox.Show(Properties.Resources.Not_a, "Dispense", MessageBoxButton.OK); |
|||
return; |
|||
} |
|||
ManualDyelot manualDyelot = new ManualDyelot(); |
|||
manualDyelot.MAC(mac.Text); |
|||
manualDyelot.Show(); |
|||
} |
|||
|
|||
private void Screen_Click(object sender, RoutedEventArgs e) |
|||
{ |
|||
if (mlock.Visibility == Visibility.Visible) |
|||
{ |
|||
MessageBox.Show(Properties.Resources.Not_a, "Dispense", MessageBoxButton.OK); |
|||
return; |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue