13 changed files with 382 additions and 10 deletions
@ -0,0 +1,60 @@ |
|||||
|
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.View.DyelotView" |
||||
|
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:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties" |
||||
|
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View" |
||||
|
mc:Ignorable="d" Loaded="UserControl_Loaded" |
||||
|
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" |
||||
|
Margin="0,0,0,0" 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.Step}" Binding="{Binding Step}" Width="80" IsReadOnly="True" /> |
||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ProductCode}" Width="150" Binding="{Binding ProductCode}" IsReadOnly="True"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ProductName}" Width="150" Binding="{Binding ProductName}" IsReadOnly="True"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ProductType}" Width="100" Binding="{Binding ProductType}" IsReadOnly="True"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="80" Binding="{Binding State}" IsReadOnly="True"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Grams}" Width="150" Binding="{Binding Grams}" IsReadOnly="True"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.DispenseGrams}" Width="150" Binding="{Binding DispenseGrams}" IsReadOnly="True"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.DispenseEndTime}" Width="200" Binding="{Binding DispenseEndTime}" IsReadOnly="True"/> |
||||
|
</DataGrid.Columns> |
||||
|
</DataGrid> |
||||
|
|
||||
|
</Grid> |
||||
|
</UserControl> |
@ -0,0 +1,54 @@ |
|||||
|
using DyeingComputer.UserClass; |
||||
|
using SunlightCentralizedControlManagement_SCCM_.UserClass; |
||||
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Data; |
||||
|
using System.Linq; |
||||
|
using System.Net; |
||||
|
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; |
||||
|
using System.Windows.Threading; |
||||
|
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; |
||||
|
|
||||
|
namespace SunlightCentralizedControlManagement_SCCM_.View |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Whole.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class DyelotView : UserControl |
||||
|
{ |
||||
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||
|
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
||||
|
|
||||
|
public DyelotView() |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
private void UserControl_Loaded(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public void Dyelot(object dat) |
||||
|
{ |
||||
|
SQLiteHelpers = new SQLiteHelper(DBAddress); |
||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||
|
DataTable dat_c = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where WorkOrder = '" + dat + "'", null).Tables[0];//缓存
|
||||
|
SQLiteHelpers.Close(); |
||||
|
|
||||
|
Grid_data.ItemsSource = dat_c.DefaultView; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
<Window x:Class="SunlightCentralizedControlManagement_SCCM_.WindowsView.UserMessage" |
||||
|
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_.WindowsView" |
||||
|
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties" |
||||
|
mc:Ignorable="d" |
||||
|
Title="UserMessage" Height="450" Width="800"> |
||||
|
<Grid Margin="0,0,0,0"> |
||||
|
<Button x:Name="Save" Content="{x:Static lang:Resources.Cancel}" HorizontalAlignment="Right" Height="35" Margin="450,0,50,10" VerticalAlignment="Bottom" Width="80" Click="Save_Click"/> |
||||
|
|
||||
|
<ContentControl x:Name="Picture" Margin="0,0,0,50"/> |
||||
|
</Grid> |
||||
|
</Window> |
@ -0,0 +1,40 @@ |
|||||
|
using SunlightCentralizedControlManagement_SCCM_.View; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
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>
|
||||
|
/// UserMessage.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class UserMessage : Window |
||||
|
{ |
||||
|
public UserMessage() |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
public void Dyelots(object dat) |
||||
|
{ |
||||
|
DyelotView dyelotView = new DyelotView(); |
||||
|
dyelotView.Dyelot(dat); |
||||
|
Picture.Content= dyelotView; |
||||
|
} |
||||
|
|
||||
|
private void Save_Click(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
this.Close(); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue