Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
eb3b176a26
13 files changed
+133
-25
No files matched your search
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace DyeingComputer.ConvertMoels
|
||||||
|
{
|
||||||
|
internal class GramsSQLConvert: IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
bool G = System.Convert.ToBoolean(value);
|
||||||
|
if (!G)//判断单元格值是否为零
|
||||||
|
{
|
||||||
|
return "black";//零返回
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "red";//非零返回红色
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -34,7 +35,6 @@ namespace DyeingComputer.ConvertMoels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
|
<Compile Include="ConvertMoels\GramsSQLConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\StatenConvert.cs" />
|
<Compile Include="ConvertMoels\StatenConvert.cs" />
|
||||||
<Compile Include="Properties\Resources.en-US.Designer.cs">
|
<Compile Include="Properties\Resources.en-US.Designer.cs">
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ namespace DyeingComputer
|
|||||||
return true;
|
return true;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
SQLiteHelpers.Close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Generated
+10
-1
@@ -205,7 +205,7 @@ namespace DyeingComputer.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 的本地化字符串。
|
/// 查找类似 NotExecuted 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string NotxEcuted {
|
public static string NotxEcuted {
|
||||||
get {
|
get {
|
||||||
@@ -285,6 +285,15 @@ namespace DyeingComputer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 State 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string State {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("State", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 SystemDataLoss 的本地化字符串。
|
/// 查找类似 SystemDataLoss 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -211,7 +211,9 @@
|
|||||||
<value>Line Up</value>
|
<value>Line Up</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NotxEcuted" xml:space="preserve">
|
<data name="NotxEcuted" xml:space="preserve">
|
||||||
<value>Not Executed
|
<value>Not Executed</value>
|
||||||
</value>
|
</data>
|
||||||
|
<data name="State" xml:space="preserve">
|
||||||
|
<value>State</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -213,4 +213,7 @@
|
|||||||
<data name="NotxEcuted" xml:space="preserve">
|
<data name="NotxEcuted" xml:space="preserve">
|
||||||
<value>NotExecuted</value>
|
<value>NotExecuted</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="State" xml:space="preserve">
|
||||||
|
<value>State</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
<value>异常</value>
|
<value>异常</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Auto" xml:space="preserve">
|
<data name="Auto" xml:space="preserve">
|
||||||
<value>自动状态</value>
|
<value>自动</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Await" xml:space="preserve">
|
<data name="Await" xml:space="preserve">
|
||||||
<value>等待命令</value>
|
<value>等待命令</value>
|
||||||
@@ -202,15 +202,18 @@
|
|||||||
<value>完成</value>
|
<value>完成</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LineUp" xml:space="preserve">
|
<data name="LineUp" xml:space="preserve">
|
||||||
<value>转入排队</value>
|
<value>排队</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Measure" xml:space="preserve">
|
<data name="Measure" xml:space="preserve">
|
||||||
<value>计量</value>
|
<value>计量</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ready" xml:space="preserve">
|
<data name="Ready" xml:space="preserve">
|
||||||
<value>准备就绪</value>
|
<value>准备</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NotxEcuted" xml:space="preserve">
|
<data name="NotxEcuted" xml:space="preserve">
|
||||||
<value>未执行</value>
|
<value>未执行</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="State" xml:space="preserve">
|
||||||
|
<value>状态</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -190,13 +190,13 @@
|
|||||||
<value>時間</value>
|
<value>時間</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Ready" xml:space="preserve">
|
<data name="Ready" xml:space="preserve">
|
||||||
<value>準備就緒</value>
|
<value>準備</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Abnormal" xml:space="preserve">
|
<data name="Abnormal" xml:space="preserve">
|
||||||
<value>異常</value>
|
<value>異常</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Auto" xml:space="preserve">
|
<data name="Auto" xml:space="preserve">
|
||||||
<value>自動狀態</value>
|
<value>自動</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Await" xml:space="preserve">
|
<data name="Await" xml:space="preserve">
|
||||||
<value>等待命令</value>
|
<value>等待命令</value>
|
||||||
@@ -213,4 +213,7 @@
|
|||||||
<data name="NotxEcuted" xml:space="preserve">
|
<data name="NotxEcuted" xml:space="preserve">
|
||||||
<value>未執行</value>
|
<value>未執行</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="State" xml:space="preserve">
|
||||||
|
<value>狀態</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -98,7 +98,7 @@ namespace DyeingComputer.UserClass
|
|||||||
{
|
{
|
||||||
mConn = OpenConnection(this.mdataFile, mPassWord);
|
mConn = OpenConnection(this.mdataFile, mPassWord);
|
||||||
}
|
}
|
||||||
Console.WriteLine("打开数据库成功");
|
Console.WriteLine("The database was opened successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -118,10 +118,10 @@ namespace DyeingComputer.UserClass
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
Console.WriteLine("关闭失败");
|
Console.WriteLine("Shutdown failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Console.WriteLine("关闭数据库成功");
|
Console.WriteLine("The database was shut down successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
+33
-10
@@ -4,9 +4,16 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:DyeingComputer.View"
|
xmlns:local="clr-namespace:DyeingComputer.View"
|
||||||
xmlns:lang="clr-namespace:DyeingComputer.Properties"
|
xmlns:lang="clr-namespace:DyeingComputer.Properties"
|
||||||
|
xmlns:viewmodel="clr-namespace:DyeingComputer.ViewModel"
|
||||||
|
xmlns:ConvertMoels="clr-namespace:DyeingComputer.ConvertMoels"
|
||||||
|
d:DataContext="{d:DesignInstance Type=viewmodel:WorkOrderViewModel}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<ConvertMoels:StatenConvert x:Key="StatenConvert"/>
|
||||||
|
<ConvertMoels:GramsSQLConvert x:Key="GramsSQLConvert"/>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Grid VerticalAlignment="Top">
|
<Grid VerticalAlignment="Top">
|
||||||
<Grid VerticalAlignment="Top">
|
<Grid VerticalAlignment="Top">
|
||||||
@@ -16,8 +23,8 @@
|
|||||||
<Button Content="{x:Static lang:Resources.Delete}" x:Name="WorkOrderView_del" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Top" Width="200" Background="White"/>
|
<Button Content="{x:Static lang:Resources.Delete}" x:Name="WorkOrderView_del" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Top" Width="200" Background="White"/>
|
||||||
<Button Content="{x:Static lang:Resources.Redye}" x:Name="WorkOrderView_redy" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="600,0,0,0" VerticalAlignment="Top" Width="200" Background="White"/>
|
<Button Content="{x:Static lang:Resources.Redye}" x:Name="WorkOrderView_redy" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="600,0,0,0" VerticalAlignment="Top" Width="200" Background="White"/>
|
||||||
|
|
||||||
<DataGrid x:Name="Grid" AlternationCount="2" IsReadOnly="True"
|
<DataGrid x:Name="Grid" AlternationCount="2" IsReadOnly="True" ItemsSource="{Binding sql}"
|
||||||
Margin="0,40,0,0" Height="400" d:ItemsSource="{d:SampleData ItemCount=99}" AutoGenerateColumns="False" MinColumnWidth="30"
|
Margin="0,40,0,0" Height="400" d:ItemsSource="{d:SampleData ItemCount=20}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2"
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2"
|
||||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False"
|
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False"
|
||||||
@@ -25,6 +32,8 @@
|
|||||||
Background="White" SelectionMode="Single" FontSize="15" VerticalAlignment="Top" >
|
Background="White" SelectionMode="Single" FontSize="15" VerticalAlignment="Top" >
|
||||||
<DataGrid.RowStyle >
|
<DataGrid.RowStyle >
|
||||||
<Style TargetType="{x:Type DataGridRow}">
|
<Style TargetType="{x:Type DataGridRow}">
|
||||||
|
<Setter Property="Height" Value="30" />
|
||||||
|
<Setter Property="FontSize" Value="25" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
||||||
<Setter Property="Background" Value="#FFFFFFFF" />
|
<Setter Property="Background" Value="#FFFFFFFF" />
|
||||||
@@ -32,8 +41,7 @@
|
|||||||
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
||||||
<Setter Property="Background" Value="#FFF0F0F0" />
|
<Setter Property="Background" Value="#FFF0F0F0" />
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="False">
|
<Trigger Property="IsMouseOver" Value="False"/>
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGrid.RowStyle>
|
</DataGrid.RowStyle>
|
||||||
@@ -45,7 +53,7 @@
|
|||||||
<Trigger Property="IsSelected" Value="True">
|
<Trigger Property="IsSelected" Value="True">
|
||||||
<Setter Property="Background" Value="#FFC0C0C0"/>
|
<Setter Property="Background" Value="#FFC0C0C0"/>
|
||||||
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
|
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
|
||||||
<Setter Property="Foreground" Value="#000000"/>
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -53,12 +61,27 @@
|
|||||||
|
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<!--列信息绑定-->
|
<!--列信息绑定-->
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.WorkOrderNumder}" Width="200" Binding="{Binding WorkOrder}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.WorkOrderNumder}" Width="200" Binding="{Binding WorkOrder}" IsReadOnly="True">
|
||||||
|
<!--事件名称:工作状态数字转文字显示,转换器StatenConvert-->
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="{x:Type TextBlock}">
|
||||||
|
<Setter Property="Foreground" Value="{Binding Path=lock,Converter={StaticResource GramsSQLConvert}}"/>
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
</DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.ProcessName}" Width="200" Binding="{Binding ProcessName}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.ProcessName}" Width="200" Binding="{Binding ProcessName}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.StartTime}" Width="200" Binding="{Binding StartTime}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="90" IsReadOnly="True">
|
||||||
|
<!--事件名称:工作状态数字转文字显示,转换器StatenConvert-->
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="{x:Type TextBlock}">
|
||||||
|
<Setter Property="Text" Value="{Binding Path=State,Converter={StaticResource StatenConvert}}"/>
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.StartTime}" Width="250" Binding="{Binding StartTime}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.Time}" Width="100" Binding="{Binding Time}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.Time}" Width="100" Binding="{Binding Time}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.EndTime}" MinWidth="200" Binding="{Binding EndTime}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.EndTime}" Width="250" Binding="{Binding EndTime}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.Remark}" MinWidth="500" Binding="{Binding Remark}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.Remark}" Width="SizeToCells" Binding="{Binding Remark}" IsReadOnly="True"/>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
using System;
|
using DyeingComputer.UserClass;
|
||||||
|
using DyeingComputer.ViewModel;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -12,6 +15,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using static DyeingComputer.UserClass.SqliteHelper;
|
||||||
|
|
||||||
namespace DyeingComputer.View
|
namespace DyeingComputer.View
|
||||||
{
|
{
|
||||||
@@ -22,7 +26,30 @@ namespace DyeingComputer.View
|
|||||||
{
|
{
|
||||||
public WorkOrderView()
|
public WorkOrderView()
|
||||||
{
|
{
|
||||||
|
DataContext = new WorkOrderViewModel();
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
workorder_sql();
|
||||||
|
}
|
||||||
|
|
||||||
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||||
|
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
||||||
|
|
||||||
|
public void workorder_sql()
|
||||||
|
{
|
||||||
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
|
||||||
|
string Work_Time = DateTime.Now.ToString("yyyy/MM/dd");
|
||||||
|
string sql_script = "select * from WorkOrder where StartTime > '" + Work_Time + "'";
|
||||||
|
DataSet sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表
|
||||||
|
if(sql!=null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转显示计划表
|
||||||
|
|
||||||
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
|
|
||||||
|
//sql.Clear(); //清除缓存
|
||||||
|
//System.GC.Collect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,24 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using static DyeingComputer.UserClass.SqliteHelper;
|
||||||
|
|
||||||
namespace DyeingComputer.ViewModel
|
namespace DyeingComputer.ViewModel
|
||||||
{
|
{
|
||||||
public class WorkOrderViewModel : ViewModelBase
|
public class WorkOrderViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public WorkOrderViewModel()
|
public WorkOrderViewModel()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user