sc 2 years ago
parent
commit
16fd9e5457
  1. 14
      MainWindow.xaml
  2. 21
      MainWindow.xaml.cs
  3. 12
      UserControls/NumberTextBox.xaml
  4. 28
      UserControls/NumberTextBox.xaml.cs
  5. 36
      formula_manage.csproj
  6. 6
      packages.config

14
MainWindow.xaml

@ -39,16 +39,20 @@
</MenuItem>
</Menu>
<Button Content="新工单" HorizontalAlignment="Left" Margin="335,35,0,0" Height="30" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" FontSize="20" Click="Button_Click"/>
<Button Content="预设工艺" HorizontalAlignment="Left" Margin="300,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Click="Button_Click1"/>
<Button Content="预设工艺" HorizontalAlignment="Left" Margin="300,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" />
<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,105,0,0" TextWrapping="Wrap" Text="机台:" VerticalAlignment="Top" Width="90" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="205,105,0,0" TextWrapping="Wrap" Text="总步数:" VerticalAlignment="Top" Width="90" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="230,105,0,0" TextWrapping="Wrap" Text="总步数:" VerticalAlignment="Top" Width="70" FontSize="20"/>
<TextBox x:Name="Number" HorizontalAlignment="Left" Height="30" Margin="95,35,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20"/>
<TextBox x:Name="Anew" HorizontalAlignment="Left" Height="30" Margin="300,35,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="30" FontSize="20" MaxLines="1" MaxLength="2"/>
<TextBox x:Name="Anew" 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"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="95,70,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20"/>
<ComboBox x:Name="Machine" HorizontalAlignment="Left" Height="30" Margin="95,105,0,0" Text="" VerticalAlignment="Top" Width="100" FontSize="20" IsEditable="True"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="300,105,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="100" FontSize="20" MaxLines="1" MaxLength="3"/>
<ComboBox x:Name="Machine" HorizontalAlignment="Left" Height="30" Margin="95,105,0,0" Text="" VerticalAlignment="Top" Width="130" FontSize="20" IsEditable="True"/>
<TextBox x:Name="Procedures_N" HorizontalAlignment="Left" Height="30" Margin="300,105,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="80" FontSize="20" MaxLines="1" MaxLength="3" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False"/>
<Button Content="+" HorizontalAlignment="Left" Height="15" Width="20" Margin="380,105,0,0" VerticalAlignment="Top" FontSize="10" Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" Click="Button_up" IsTabStop="False"/>
<Button Content="-" HorizontalAlignment="Left" Height="15" Width="20" Margin="380,120,0,0" VerticalAlignment="Top" FontSize="10" Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" Click="Button_dow" IsTabStop="False"/>
<DataGrid x:Name="Selectio" AlternationCount="2" IsReadOnly="False"
Margin="5,300,5,100" d:ItemsSource="{d:SampleData ItemCount=200}" AutoGenerateColumns="False" MinColumnWidth="30"

21
MainWindow.xaml.cs

@ -2,11 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
@ -38,6 +40,14 @@ namespace formula_manage
Number.Text = Prepose + System.DateTime.Now.ToString("yyyyMMddHHmmss"); //生成料单号
}
private void Tb_KeyPress(object sender, TextCompositionEventArgs e)//正则表达式只允许数字
{
//Regex re = new Regex("[^0-9.-]+");
Regex re = new Regex(@"^[0-9]+(.[0-9]{1,3})?$");
e.Handled = !re.IsMatch(e.Text);
}
private void SQL(object sender, RoutedEventArgs e)
{
Windows.Sql sql= new Windows.Sql();
@ -92,10 +102,17 @@ namespace formula_manage
Number.Text = Prepose + System.DateTime.Now.ToString("yyyyMMddHHmmss"); ;
}
private void Button_Click1(object sender, RoutedEventArgs e)
{
private void Button_up(object sender, RoutedEventArgs e)
{
int i = int.Parse(Procedures_N.Text);
if (i < 999) Procedures_N.Text = ( i + 1).ToString();
}
private void Button_dow(object sender, RoutedEventArgs e)
{
int i = int.Parse(Procedures_N.Text);
if (i > 1) Procedures_N.Text = (i - 1).ToString();
}
}
}

12
UserControls/NumberTextBox.xaml

@ -1,12 +0,0 @@
<UserControl x:Class="formula_manage.UserControls.NumberTextBox"
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:formula_manage.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

28
UserControls/NumberTextBox.xaml.cs

@ -1,28 +0,0 @@
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.Navigation;
using System.Windows.Shapes;
namespace formula_manage.UserControls
{
/// <summary>
/// NumberTextBox.xaml 的交互逻辑
/// </summary>
public partial class NumberTextBox : UserControl
{
public NumberTextBox()
{
InitializeComponent();
}
}
}

36
formula_manage.csproj

@ -54,6 +54,15 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<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>
</Reference>
<Reference Include="ModernUI.Xceed.AvalonDock, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SamOatesGames.ModernUI.Xceed.Toolkit.1.0.1905191936\lib\net45\ModernUI.Xceed.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="ModernUI.Xceed.Toolkit, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SamOatesGames.ModernUI.Xceed.Toolkit.1.0.1905191936\lib\net45\ModernUI.Xceed.Toolkit.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
@ -69,6 +78,21 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
@ -82,9 +106,6 @@
</Compile>
<Compile Include="UserClass\IniFile.cs" />
<Compile Include="UserClass\PressKey.cs" />
<Compile Include="UserControls\NumberTextBox.xaml.cs">
<DependentUpon>NumberTextBox.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\APP_set.xaml.cs">
<DependentUpon>APP_set.xaml</DependentUpon>
</Compile>
@ -120,10 +141,6 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="UserControls\NumberTextBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\APP_set.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -159,6 +176,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -191,6 +209,8 @@
<ItemGroup>
<Resource Include="Windows\sunlight_logo.jpg" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="UserControls\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

6
packages.config

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Extended.Wpf.Toolkit" version="3.5.0" targetFramework="net46" />
<package id="ModernUI.WPF" version="1.0.9" targetFramework="net46" />
<package id="SamOatesGames.ModernUI.Xceed.Toolkit" version="1.0.1905191936" targetFramework="net46" />
</packages>
Loading…
Cancel
Save