Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage
This commit is contained in:
commit
b4e7e04a9e
8 files changed
+220
-38
No files matched your search
+8
-4
@@ -1,13 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||||
</startup>
|
</startup>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Xceed.Wpf.AvalonDock" publicKeyToken="3e4669d2f30244f4" culture="neutral"/>
|
<assemblyIdentity name="Xceed.Wpf.AvalonDock" publicKeyToken="3e4669d2f30244f4" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="FastReport.Compat" publicKeyToken="406e1f4c3c8ef97e" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-2024.1.0.0" newVersion="2024.1.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|||||||
+12
-21
@@ -13,10 +13,6 @@
|
|||||||
<ViewModel:MainWindowViewModel x:Key="MainWindowViewModel"/>
|
<ViewModel:MainWindowViewModel x:Key="MainWindowViewModel"/>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="131*"/>
|
|
||||||
<ColumnDefinition Width="509*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Menu IsTabStop="False" Grid.ColumnSpan="2">
|
<Menu IsTabStop="False" Grid.ColumnSpan="2">
|
||||||
<MenuItem x:Name="tab" Header="_文件" FontSize="16" Focusable ="False" >
|
<MenuItem x:Name="tab" Header="_文件" FontSize="16" Focusable ="False" >
|
||||||
<MenuItem Header="_许可证" FontSize="16"/>
|
<MenuItem Header="_许可证" FontSize="16"/>
|
||||||
@@ -59,10 +55,9 @@
|
|||||||
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/>
|
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/>
|
||||||
<TextBox x:Name="USER" HorizontalAlignment="Right" Height="30" Margin="0,0,155,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="100" FontSize="14"
|
<TextBox x:Name="USER" HorizontalAlignment="Right" Height="30" Margin="0,0,155,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="100" FontSize="14"
|
||||||
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/>
|
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/>
|
||||||
|
<Button Content="新工单" HorizontalAlignment="Left" Margin="335,35,0,0" Height="30" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" FontSize="20" Click="Button_NewOrder" Focusable ="False" Grid.Column="1"/>
|
||||||
<Button Content="新工单" HorizontalAlignment="Left" Margin="73,35,0,0" Height="30" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" FontSize="20" Click="Button_NewOrder" Focusable ="False" Grid.Column="1"/>
|
<Button Content="归属订单" HorizontalAlignment="Left" Margin="300,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology" Grid.Column="1"/>
|
||||||
<Button Content="归属订单" HorizontalAlignment="Left" Margin="38,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology" Grid.Column="1"/>
|
<Button Content="预设工艺" HorizontalAlignment="Left" Margin="300,105,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology" Grid.Column="1"/>
|
||||||
<Button Content="预设工艺" HorizontalAlignment="Left" Margin="38,105,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology" Grid.Column="1"/>
|
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,35,0,0" TextWrapping="Wrap" Text="领料单号:" VerticalAlignment="Top" Width="90" FontSize="20" Background="WhiteSmoke"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,35,0,0" TextWrapping="Wrap" Text="领料单号:" VerticalAlignment="Top" Width="90" FontSize="20" Background="WhiteSmoke"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,70,0,0" TextWrapping="Wrap" Text="流转订单:" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,70,0,0" TextWrapping="Wrap" Text="流转订单:" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,105,0,0" TextWrapping="Wrap" Text="执行工艺:" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,105,0,0" TextWrapping="Wrap" Text="执行工艺:" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
||||||
@@ -70,10 +65,10 @@
|
|||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,175,0,0" TextWrapping="Wrap" Text="类型:" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,175,0,0" TextWrapping="Wrap" Text="类型:" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="230,140,0,0" TextWrapping="Wrap" Text="总步数:" VerticalAlignment="Top" Width="70" FontSize="20" Grid.ColumnSpan="2"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="230,140,0,0" TextWrapping="Wrap" Text="总步数:" VerticalAlignment="Top" Width="70" FontSize="20" Grid.ColumnSpan="2"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="230,175,0,0" TextWrapping="Wrap" Text="表单:" VerticalAlignment="Top" Width="70" FontSize="20" Grid.ColumnSpan="2"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="230,175,0,0" TextWrapping="Wrap" Text="表单:" VerticalAlignment="Top" Width="70" FontSize="20" Grid.ColumnSpan="2"/>
|
||||||
<ComboBox x:Name="Forms_" HorizontalAlignment="Left" Height="30" Margin="38,175,0,0" VerticalAlignment="Top" Width="105" FontSize="20" IsTabStop="True" Grid.Column="1"/>
|
<ComboBox x:Name="Forms_" HorizontalAlignment="Left" Height="30" Margin="300,175,0,0" VerticalAlignment="Top" Width="105" FontSize="20" IsTabStop="True" Grid.Column="1"/>
|
||||||
<TextBox x:Name="Number" HorizontalAlignment="Left" ToolTip="当前配方的物料单" Height="30" Margin="95,35,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" Grid.ColumnSpan="2"/>
|
<TextBox x:Name="Number" HorizontalAlignment="Left" ToolTip="当前配方的物料单" Height="30" Margin="95,35,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" Grid.ColumnSpan="2"/>
|
||||||
<TextBox HorizontalAlignment="Left" Height="30" Margin="95,70,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" IsTabStop="False" Grid.ColumnSpan="2"/>
|
<TextBox HorizontalAlignment="Left" Height="30" Margin="95,70,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" IsTabStop="False" Grid.ColumnSpan="2"/>
|
||||||
<TextBox x:Name="ReDye" HorizontalAlignment="Left" Height="30" Margin="38,35,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="30" FontSize="20"
|
<TextBox x:Name="ReDye" HorizontalAlignment="Left" Height="30" Margin="300,35,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="30" FontSize="20"
|
||||||
MaxLines="1" MaxLength="2" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" Focusable ="False" Grid.Column="1"/>
|
MaxLines="1" MaxLength="2" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" Focusable ="False" Grid.Column="1"/>
|
||||||
<TextBox HorizontalAlignment="Left" Height="30" Margin="95,105,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" IsTabStop="False" Grid.ColumnSpan="2"/>
|
<TextBox HorizontalAlignment="Left" Height="30" Margin="95,105,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" IsTabStop="False" Grid.ColumnSpan="2"/>
|
||||||
<ComboBox x:Name="Machine" DisplayMemberPath="Name"
|
<ComboBox x:Name="Machine" DisplayMemberPath="Name"
|
||||||
@@ -86,19 +81,15 @@
|
|||||||
<ComboBoxItem Content="正常单"></ComboBoxItem>
|
<ComboBoxItem Content="正常单"></ComboBoxItem>
|
||||||
<ComboBoxItem Content="追加单"></ComboBoxItem>
|
<ComboBoxItem Content="追加单"></ComboBoxItem>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<TextBox x:Name="Procedures_N" HorizontalAlignment="Left" Height="30" Margin="38,140,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="85" FontSize="20"
|
<TextBox x:Name="Procedures_N" HorizontalAlignment="Left" Height="30" Margin="300,140,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="85" FontSize="20"
|
||||||
KeyUp="SearchBox_OnKeyDownd" MaxLines="1" MaxLength="3" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" Grid.Column="1"/>
|
KeyUp="SearchBox_OnKeyDownd" MaxLines="1" MaxLength="3" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" Grid.Column="1"/>
|
||||||
<Button Content="+" HorizontalAlignment="Left" Height="15" Width="20" Margin="123,140,0,0" VerticalAlignment="Top" FontSize="10"
|
<Button Content="+" HorizontalAlignment="Left" Height="15" Width="20" Margin="385,140,0,0" VerticalAlignment="Top" FontSize="10"
|
||||||
Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" Click="Button_up" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
|
Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" Click="Button_up" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
|
||||||
<Button Content="-" HorizontalAlignment="Left" Height="15" Width="20" Margin="123,155,0,0" VerticalAlignment="Top" FontSize="10"
|
<Button Content="-" HorizontalAlignment="Left" Height="15" Width="20" Margin="385,155,0,0" VerticalAlignment="Top" FontSize="10"
|
||||||
Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" Click="Button_dow" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
|
Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" Click="Button_dow" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
|
||||||
|
|
||||||
<Grid Height="150" Width="405" Margin="5,210,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#FFF7F7F7" Grid.ColumnSpan="2">
|
<Grid Height="150" Width="405" Margin="5,210,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#FFF7F7F7" Grid.ColumnSpan="2">
|
||||||
<Grid.ColumnDefinitions>
|
<Button Content="..." HorizontalAlignment="Left" Margin="370,40,0,0" Height="30" VerticalAlignment="Top" Width="30" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Formula" Grid.Column="1"/>
|
||||||
<ColumnDefinition Width="254"/>
|
|
||||||
<ColumnDefinition Width="151"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Button Content="..." HorizontalAlignment="Left" Margin="116,40,0,0" Height="30" VerticalAlignment="Top" Width="30" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Formula" Grid.Column="1"/>
|
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="0,5,0,0" TextWrapping="Wrap" Text="步序:" VerticalAlignment="Top" Width="70" FontSize="20"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="0,5,0,0" TextWrapping="Wrap" Text="步序:" VerticalAlignment="Top" Width="70" FontSize="20"/>
|
||||||
<TextBox x:Name="Procedures_P" HorizontalAlignment="Left" Height="30" Margin="90,5,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="50" FontSize="20"
|
<TextBox x:Name="Procedures_P" HorizontalAlignment="Left" Height="30" Margin="90,5,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="50" FontSize="20"
|
||||||
KeyUp="SearchBox_OnKeyDownd" MaxLines="1" MaxLength="3" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False"/>
|
KeyUp="SearchBox_OnKeyDownd" MaxLines="1" MaxLength="3" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False"/>
|
||||||
@@ -116,12 +107,12 @@
|
|||||||
<TextBox x:Name="list_Weight" HorizontalAlignment="Left" Height="30" Margin="90,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="125" FontSize="20"
|
<TextBox x:Name="list_Weight" HorizontalAlignment="Left" Height="30" Margin="90,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="125" FontSize="20"
|
||||||
KeyUp="SearchBox_OnKeyDownd" TextChanged="Weight" PreviewTextInput="Tb_KeyFloating" InputMethod.IsInputMethodEnabled="False"/>
|
KeyUp="SearchBox_OnKeyDownd" TextChanged="Weight" PreviewTextInput="Tb_KeyFloating" InputMethod.IsInputMethodEnabled="False"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="220,75,0,0" TextWrapping="Wrap" Text="浴比:" VerticalAlignment="Top" Width="90" FontSize="20" Grid.ColumnSpan="2"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="220,75,0,0" TextWrapping="Wrap" Text="浴比:" VerticalAlignment="Top" Width="90" FontSize="20" Grid.ColumnSpan="2"/>
|
||||||
<TextBox x:Name="list_Proportion" HorizontalAlignment="Left" Height="30" Margin="16,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="130" FontSize="20"
|
<TextBox x:Name="list_Proportion" HorizontalAlignment="Left" Height="30" Margin="270,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="130" FontSize="20"
|
||||||
KeyUp="SearchBox_OnKeyDownd" TextChanged="Proportion" PreviewTextInput="Tb_KeyFloating" InputMethod.IsInputMethodEnabled="False" Grid.Column="1"/>
|
KeyUp="SearchBox_OnKeyDownd" TextChanged="Proportion" PreviewTextInput="Tb_KeyFloating" InputMethod.IsInputMethodEnabled="False" Grid.Column="1"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="0,110,0,0" TextWrapping="Wrap" Text="浴量(L):" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="0,110,0,0" TextWrapping="Wrap" Text="浴量(L):" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
||||||
<TextBox x:Name="list_Total" HorizontalAlignment="Left" Height="30" Margin="90,110,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="125" FontSize="20" />
|
<TextBox x:Name="list_Total" HorizontalAlignment="Left" Height="30" Margin="90,110,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="125" FontSize="20" />
|
||||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="220,110,0,0" TextWrapping="Wrap" Text="修正:" VerticalAlignment="Top" Width="90" FontSize="20" Grid.ColumnSpan="2"/>
|
<TextBlock HorizontalAlignment="Left" Height="35" Margin="220,110,0,0" TextWrapping="Wrap" Text="修正:" VerticalAlignment="Top" Width="90" FontSize="20" Grid.ColumnSpan="2"/>
|
||||||
<TextBox HorizontalAlignment="Left" Height="30" Margin="16,110,0,0" Text="" VerticalAlignment="Top" Width="130" FontSize="20" Focusable ="False" Grid.Column="1"/>
|
<TextBox HorizontalAlignment="Left" Height="30" Margin="270,110,0,0" Text="" VerticalAlignment="Top" Width="130" FontSize="20" Focusable ="False" Grid.Column="1"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<DataGrid x:Name="Grid_RRODUCT" AlternationCount="2" IsReadOnly="False" InitializingNewItem="DataGrid_InitializingNewItem"
|
<DataGrid x:Name="Grid_RRODUCT" AlternationCount="2" IsReadOnly="False" InitializingNewItem="DataGrid_InitializingNewItem"
|
||||||
@@ -229,7 +220,7 @@
|
|||||||
<Button x:Name="Save" Content="保存" IsEnabled="False" HorizontalAlignment="Left" Height="40" Width="80" Margin="15,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="save" IsTabStop="False" Focusable ="False"/>
|
<Button x:Name="Save" Content="保存" IsEnabled="False" HorizontalAlignment="Left" Height="40" Width="80" Margin="15,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="save" IsTabStop="False" Focusable ="False"/>
|
||||||
<Button x:Name="Delete" Content="删除" IsEnabled="False" HorizontalAlignment="Left" Height="40" Width="80" Margin="100,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="delete" IsTabStop="False" Focusable ="False"/>
|
<Button x:Name="Delete" Content="删除" IsEnabled="False" HorizontalAlignment="Left" Height="40" Width="80" Margin="100,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="delete" IsTabStop="False" Focusable ="False"/>
|
||||||
|
|
||||||
<Grid Grid.Column="1" Height="325" Margin="148,35,5,0" VerticalAlignment="Top" Background="#FFF7F7F7">
|
<Grid Grid.Column="1" Height="325" Margin="415,35,5,0" VerticalAlignment="Top" Background="#FFF7F7F7">
|
||||||
<ContentControl x:Name="Deputy"/>
|
<ContentControl x:Name="Deputy"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ namespace formula_manage
|
|||||||
{
|
{
|
||||||
Font font = new Font("Microsoft YaHei", 20);
|
Font font = new Font("Microsoft YaHei", 20);
|
||||||
|
|
||||||
|
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
// DataTable DissolvedataTable = new DataTable(); //建立Dissolve缓存
|
// DataTable DissolvedataTable = new DataTable(); //建立Dissolve缓存
|
||||||
// DataTable STUFFdataTable = new DataTable(); //建立STUFF缓存
|
// DataTable STUFFdataTable = new DataTable(); //建立STUFF缓存
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ namespace formula_manage.UserClass
|
|||||||
{
|
{
|
||||||
internal class PressKey
|
internal class PressKey
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 键盘模拟
|
||||||
|
/// </summary>
|
||||||
[DllImport("user32.dll", SetLastError = true)]
|
[DllImport("user32.dll", SetLastError = true)]
|
||||||
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);
|
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);
|
||||||
public static void PressKeys(Keys key, bool up)
|
public static void PressKeys(Keys key, bool up)
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
using FastReport;
|
||||||
|
using FastReport.Data;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace formula_manage.UserClass
|
||||||
|
{
|
||||||
|
public class PrintHelper
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 打印
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="printerName">打印机</param>
|
||||||
|
/// <param name="frxPath">模板</param>
|
||||||
|
/// <param name="dicParam">字典参数</param>
|
||||||
|
/// <param name="dsDataSource">数据源</param>
|
||||||
|
/// <param name="printNum">打印数量</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Tuple<bool, string> Print(string printerName, string frxPath, Dictionary<string, object> dicParam, DataSet dsDataSource, int printNum = 1)
|
||||||
|
{
|
||||||
|
bool flag = false;
|
||||||
|
string msg = "";
|
||||||
|
FastReport.Report report = new FastReport.Report();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
report.Load(frxPath);
|
||||||
|
report.DoublePass = true;
|
||||||
|
if (dicParam != null && dicParam.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in dicParam)
|
||||||
|
{
|
||||||
|
report.SetParameterValue(item.Key, item.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dsDataSource != null && dsDataSource.Tables.Count > 0)
|
||||||
|
{
|
||||||
|
report.RegisterData(dsDataSource);
|
||||||
|
foreach (DataSourceBase dataSourceBase in report.Dictionary.DataSources)
|
||||||
|
{
|
||||||
|
dataSourceBase.Enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
report.PrintSettings.ShowDialog = false;
|
||||||
|
report.PrintSettings.Printer = printerName;
|
||||||
|
report.PrintSettings.PrintMode = PrintMode.Split;
|
||||||
|
EnvironmentSettings envSet = new EnvironmentSettings();
|
||||||
|
envSet.ReportSettings.ShowProgress = false;
|
||||||
|
for (int i = 0; i < printNum; i++)
|
||||||
|
{
|
||||||
|
report.Print();
|
||||||
|
}
|
||||||
|
flag = true;
|
||||||
|
msg = "打印成功";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
msg = ex.Message;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
report.Dispose();
|
||||||
|
}
|
||||||
|
return new Tuple<bool, string>(flag, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设计
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="frxPath">模板</param>
|
||||||
|
/// <param name="dicParam">字典参数</param>
|
||||||
|
/// <param name="dsDataSource">数据源</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Tuple<bool, string> Design(string frxPath, Dictionary<string, object> dicParam, DataSet dsDataSource)
|
||||||
|
{
|
||||||
|
bool flag = false;
|
||||||
|
string msg = "";
|
||||||
|
FastReport.Report report = new FastReport.Report();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
report.Load(frxPath);
|
||||||
|
report.DoublePass = true;
|
||||||
|
if (dicParam != null && dicParam.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in dicParam)
|
||||||
|
{
|
||||||
|
report.SetParameterValue(item.Key, item.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dsDataSource != null && dsDataSource.Tables.Count > 0)
|
||||||
|
{
|
||||||
|
report.RegisterData(dsDataSource);
|
||||||
|
foreach (DataSourceBase dataSourceBase in report.Dictionary.DataSources)
|
||||||
|
{
|
||||||
|
dataSourceBase.Enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
report.Design();
|
||||||
|
flag = true;
|
||||||
|
msg = "设计器打开成功";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
msg = ex.Message;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
report.Dispose();
|
||||||
|
}
|
||||||
|
return new Tuple<bool, string>(flag, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+50
-12
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
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;
|
||||||
@@ -13,6 +14,10 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using ThoughtWorks.QRCode.Codec;
|
using ThoughtWorks.QRCode.Codec;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.Drawing.Printing;
|
||||||
|
using formula_manage.UserClass;
|
||||||
|
|
||||||
namespace formula_manage.Windows
|
namespace formula_manage.Windows
|
||||||
{
|
{
|
||||||
@@ -23,6 +28,7 @@ namespace formula_manage.Windows
|
|||||||
{
|
{
|
||||||
public Print()
|
public Print()
|
||||||
{
|
{
|
||||||
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,25 +45,57 @@ namespace formula_manage.Windows
|
|||||||
}
|
}
|
||||||
private void Button_Click_1(object sender, RoutedEventArgs e) //SQL_DISPEN_bak路径选择按钮
|
private void Button_Click_1(object sender, RoutedEventArgs e) //SQL_DISPEN_bak路径选择按钮
|
||||||
{
|
{
|
||||||
FolderBrowserDialog Dilog = new FolderBrowserDialog();
|
if (string.IsNullOrEmpty(Print_path.Text))
|
||||||
Dilog.SelectedPath = Print_path.Text; //打开目录
|
|
||||||
Dilog.ShowNewFolderButton = false; //不显示新建文件夹按钮
|
|
||||||
//
|
|
||||||
if (Dilog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
|
||||||
{
|
{
|
||||||
Print_path.Text = Dilog.SelectedPath; //返回选择的字符串
|
System.Windows.MessageBox.Show("模板不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var data = this.CreateBillData();
|
||||||
|
if (!data.Item1)
|
||||||
|
{
|
||||||
|
System.Windows.MessageBox.Show("模拟数据生成错误");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tuple = PrintHelper.Design(Print_path.Text, data.Item2, data.Item3);
|
||||||
|
if (!tuple.Item1)
|
||||||
|
{
|
||||||
|
System.Windows.MessageBox.Show($"打开设计器失败:{tuple.Item2}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void Button_Click_2(object sender, RoutedEventArgs e) //SQL_DISPEN_bak路径选择按钮
|
private void Button_Click_2(object sender, RoutedEventArgs e) //SQL_DISPEN_bak路径选择按钮
|
||||||
{
|
{
|
||||||
FolderBrowserDialog Dilog = new FolderBrowserDialog();
|
|
||||||
Dilog.SelectedPath = Print_path.Text; //打开目录
|
}
|
||||||
Dilog.ShowNewFolderButton = false; //不显示新建文件夹按钮
|
|
||||||
//
|
private Tuple<bool, Dictionary<string, object>, DataSet> CreateBillData()
|
||||||
if (Dilog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
{
|
||||||
|
//注意事项
|
||||||
|
//小票打印和门票一样,主要的区别是小票动态数据会变化,小票的长度也会动态改变
|
||||||
|
//这里主要演示下 动态数据源 为了动态拉伸,除了传入数据源,在模板上面code部分需要加代码
|
||||||
|
Dictionary<string, object> dic = new Dictionary<string, object>();
|
||||||
|
dic.Add("billNo", "2018111100002222");
|
||||||
|
dic.Add("optorName", "管理员");
|
||||||
|
|
||||||
|
//组装dataset数据源
|
||||||
|
DataTable dtDetail = new DataTable("dtDetail");
|
||||||
|
dtDetail.Columns.Add("GOODSCODE");
|
||||||
|
dtDetail.Columns.Add("GOODSNAME");
|
||||||
|
dtDetail.Columns.Add("GOODSPRICE");
|
||||||
|
dtDetail.Columns.Add("GOODSCOUNT");
|
||||||
|
dtDetail.Columns.Add("PAYSUM");
|
||||||
|
|
||||||
|
//加10种商品
|
||||||
|
for (int i = 1; i <= 10; i++)
|
||||||
{
|
{
|
||||||
Print_path.Text = Dilog.SelectedPath; //返回选择的字符串
|
dtDetail.Rows.Add("10000" + 1, "测试商品" + i, 10.00m, 5, 50.00m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DataSet dsFrx = new DataSet();
|
||||||
|
dsFrx.Tables.Add(dtDetail);
|
||||||
|
|
||||||
|
return new Tuple<bool, Dictionary<string, object>, DataSet>(true, dic, dsFrx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,9 +101,31 @@
|
|||||||
<StartupObject>formula_manage.App</StartupObject>
|
<StartupObject>formula_manage.App</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Accessibility" />
|
||||||
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
|
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
|
<HintPath>packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="FastReport, Version=2024.1.2.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\FastReport.Net.Demo.2024.1.2\lib\net462\FastReport.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="FastReport.Bars, Version=2024.1.2.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\FastReport.Net.Demo.2024.1.2\lib\net462\FastReport.Bars.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="FastReport.Compat, Version=2024.1.0.0, Culture=neutral, PublicKeyToken=406e1f4c3c8ef97e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\FastReport.Compat.2024.1.0\lib\net40\FastReport.Compat.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="FastReport.DataVisualization, Version=2024.1.0.0, Culture=neutral, PublicKeyToken=406e1f4c3c8ef97e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\FastReport.DataVisualization.2024.1.0\lib\net40\FastReport.DataVisualization.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="FastReport.Editor, Version=2024.1.2.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\FastReport.Net.Demo.2024.1.2\lib\net462\FastReport.Editor.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="FastReport.VSDesign, Version=1.0.0.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\FastReport.Net.Demo.2024.1.2\lib\net462\FastReport.VSDesign.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="FastReport.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\FastReport.Net.Demo.2024.1.2\lib\net462\FastReport.Web.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="FirstFloor.ModernUI, Version=1.0.9.0, Culture=neutral, PublicKeyToken=bc9b0c37bf06c6a9, processorArchitecture=MSIL">
|
<Reference Include="FirstFloor.ModernUI, Version=1.0.9.0, Culture=neutral, PublicKeyToken=bc9b0c37bf06c6a9, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\ModernUI.WPF.1.0.9\lib\net45\FirstFloor.ModernUI.dll</HintPath>
|
<HintPath>packages\ModernUI.WPF.1.0.9\lib\net45\FirstFloor.ModernUI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -127,6 +149,7 @@
|
|||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Printing" />
|
<Reference Include="System.Printing" />
|
||||||
|
<Reference Include="System.Security" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||||
@@ -186,6 +209,7 @@
|
|||||||
<Compile Include="UserClass\IniFile.cs" />
|
<Compile Include="UserClass\IniFile.cs" />
|
||||||
<Compile Include="UserClass\PressKey.cs" />
|
<Compile Include="UserClass\PressKey.cs" />
|
||||||
<Compile Include="UserClass\DataTableForToObservableCollection.cs" />
|
<Compile Include="UserClass\DataTableForToObservableCollection.cs" />
|
||||||
|
<Compile Include="UserClass\PrintHelper.cs" />
|
||||||
<Compile Include="UserClass\UserPrint.cs" />
|
<Compile Include="UserClass\UserPrint.cs" />
|
||||||
<Compile Include="ViewModel\MainWindowViewModel.cs" />
|
<Compile Include="ViewModel\MainWindowViewModel.cs" />
|
||||||
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net46" />
|
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net46" />
|
||||||
<package id="Extended.Wpf.Toolkit" version="4.5.1" targetFramework="net46" />
|
<package id="Extended.Wpf.Toolkit" version="4.5.1" targetFramework="net46" />
|
||||||
|
<package id="FastReport.Compat" version="2024.1.0" targetFramework="net462" />
|
||||||
|
<package id="FastReport.DataVisualization" version="2024.1.0" targetFramework="net462" />
|
||||||
|
<package id="FastReport.Net.Demo" version="2024.1.2" targetFramework="net462" />
|
||||||
<package id="ModernUI.WPF" version="1.0.9" targetFramework="net46" />
|
<package id="ModernUI.WPF" version="1.0.9" targetFramework="net46" />
|
||||||
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net46" />
|
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net46" />
|
||||||
<package id="SamOatesGames.ModernUI.Xceed.Toolkit" version="1.0.1905191936" targetFramework="net46" />
|
<package id="SamOatesGames.ModernUI.Xceed.Toolkit" version="1.0.1905191936" targetFramework="net46" />
|
||||||
|
|||||||
Reference in new issue
Block a user