diff --git a/MainWindow.xaml b/MainWindow.xaml
index b1004d7..41e06c6 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -4,7 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage"
- mc:Ignorable="d"
+ mc:Ignorable="d" Loaded="Window_MIN"
Title="SUNLIGHT" Height="720" Width="1280" BorderBrush="White" Background="#FFE0E0E0">
-
+
+
+
+
+
+
+
+
+
-
+
+
-
@@ -89,5 +98,7 @@
+
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index fefe109..7efa8cc 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -24,7 +24,19 @@ namespace formula_manage
public MainWindow()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
- InitializeComponent();
+ InitializeComponent();
+ }
+ public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini";
+
+ string Prepose; //料单前置
+
+ private void Window_MIN(object sender, RoutedEventArgs e)
+ {
+
+ UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
+ Prepose = Configini.IniReadvalue("SOFTWARE_SET", "L3"); //自定义料单前缀
+ Number.Text = Prepose + System.DateTime.Now.ToString("yyyyMMddHHmmss"); //生成料单号
+
}
private void SQL(object sender, RoutedEventArgs e)
{
@@ -74,5 +86,16 @@ namespace formula_manage
{
}
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ Number.Text = Prepose + System.DateTime.Now.ToString("yyyyMMddHHmmss"); ;
+ }
+
+ private void Button_Click1(object sender, RoutedEventArgs e)
+ {
+
+ }
+
}
}
diff --git a/Windows/APP_set.xaml b/Windows/APP_set.xaml
index b81fd2b..2a7390b 100644
--- a/Windows/APP_set.xaml
+++ b/Windows/APP_set.xaml
@@ -9,6 +9,8 @@
+
+
diff --git a/Windows/APP_set.xaml.cs b/Windows/APP_set.xaml.cs
index 6d7c1ab..6f3b148 100644
--- a/Windows/APP_set.xaml.cs
+++ b/Windows/APP_set.xaml.cs
@@ -23,9 +23,18 @@ namespace formula_manage.Windows
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
+ this.Closing += Window_Closing; //添加窗口关闭事件
}
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini";
+ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
+ {
+ UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
+ Configini.IniWritevalue("SOFTWARE_SET", " L1", Loginlink.ToString());
+ Configini.IniWritevalue("SOFTWARE_SET", " L2", Loginprint.ToString());
+ Configini.IniWritevalue("SOFTWARE_SET", " L3",Prepose.Text);
+ }
+
bool Loginlink;
bool Loginprint;
private void Window_SET(object sender, RoutedEventArgs e)
@@ -35,20 +44,17 @@ namespace formula_manage.Windows
Login_LINK.IsChecked = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L1")); //连接状态显示是否生效
Login_PRINT.IsChecked = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L2")); //是否立即打印料单
+ Prepose.Text = Configini.IniReadvalue("SOFTWARE_SET", "L3"); //自定义料单前缀
}
private void Login_LINK_Checked(object sender, RoutedEventArgs e)
{
Loginlink = Login_LINK.IsChecked.GetValueOrDefault(); //显示是否生效
- UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); //配置文件
- Configini.IniWritevalue("SOFTWARE_SET", " L1", Loginlink.ToString());
}
private void Login_PRINT_Checked(object sender, RoutedEventArgs e)
{
Loginprint = Login_PRINT.IsChecked.GetValueOrDefault(); //是否立即打印料单
- UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); //配置文件
- Configini.IniWritevalue("SOFTWARE_SET", " L2", Loginprint.ToString());
}
}
}