sc 2 years ago
parent
commit
e2e5e66ac5
  1. 6
      App.xaml.cs
  2. 8
      Login.xaml.cs
  3. 16
      MainWindow.xaml
  4. 3
      MainWindow.xaml.cs

6
App.xaml.cs

@ -12,7 +12,11 @@ namespace formula_manage
/// App.xaml 的交互逻辑 /// App.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class App : Application public partial class App : Application
{ { /// <summary>
///公共变量来自Login的用户名
/// </summary>
public static string USER_Purview { get; set; }
public App() public App()
{ {
this.Startup += new StartupEventHandler(App_Startup); this.Startup += new StartupEventHandler(App_Startup);

8
Login.xaml.cs

@ -62,17 +62,19 @@ namespace formula_manage
private void Button_Click_1(object sender, RoutedEventArgs e) //登录按钮事件 private void Button_Click_1(object sender, RoutedEventArgs e) //登录按钮事件
{ {
// if ((User.Text == "engineer" || User.Text == "ENGINEER") && (Pasword.Password == "engineer" || Pasword.Password == "ENGINEER")) if ((User.Text == "engineer" || User.Text == "ENGINEER") && (Pasword.Password == "engineer" || Pasword.Password == "ENGINEER"))
{ {
App.USER_Purview = "ENGINEER";//传入用户名
Window window = Window.GetWindow(this); Window window = Window.GetWindow(this);
MainWindow Main = new MainWindow(); MainWindow Main = new MainWindow();
window.Close(); window.Close();
Main.ShowDialog();//实例化并置顶打开信息窗口 Main.ShowDialog();//实例化并置顶打开信息窗口
} }
/* else else
{ {
System.Windows.MessageBox.Show("账号或密码错误"); System.Windows.MessageBox.Show("账号或密码错误");
}*/ }
} }
private void SearchBox_OnKeyDownd(object sender, System.Windows.Input.KeyEventArgs e) //回车跳转功能 private void SearchBox_OnKeyDownd(object sender, System.Windows.Input.KeyEventArgs e) //回车跳转功能

16
MainWindow.xaml

@ -9,15 +9,17 @@
BorderBrush="White" Background="#FFE0E0E0"> BorderBrush="White" Background="#FFE0E0E0">
<Grid> <Grid>
<Menu IsTabStop="False"> <Menu IsTabStop="False">
<MenuItem x:Name="tab" Header="_设置" FontSize="16" Focusable ="False" > <MenuItem x:Name="tab" Header="_文件" FontSize="16" Focusable ="False" >
<MenuItem Header="_许可证" FontSize="16"/>
<Separator/>
<MenuItem Header="_注销" FontSize="16"/>
</MenuItem>
<MenuItem Header="_设置" FontSize="16" Focusable ="False" >
<MenuItem Header="_数据库设置" FontSize="16" Click="SQL"/> <MenuItem Header="_数据库设置" FontSize="16" Click="SQL"/>
<MenuItem Header="_备份/还原" FontSize="16" Click="SQLBAK"/> <MenuItem Header="_备份/还原" FontSize="16" Click="SQLBAK"/>
<Separator/> <Separator/>
<MenuItem Header="_软件设置" FontSize="16" Click="SOFTWARE_SET"/> <MenuItem Header="_软件设置" FontSize="16" Click="SOFTWARE_SET"/>
<MenuItem Header="_用户设置" FontSize="16" Click="USER_SET"/> <MenuItem Header="_用户设置" FontSize="16" Click="USER_SET"/>
<Separator/>
<MenuItem Header="_许可证" FontSize="16"/>
<MenuItem Header="_帮助" FontSize="16" Click="HELP"/>
</MenuItem> </MenuItem>
<MenuItem Header="_管理" FontSize="16" Focusable ="False"> <MenuItem Header="_管理" FontSize="16" Focusable ="False">
<MenuItem Header="_染色机管理" FontSize="16" Click="MAC_SET"/> <MenuItem Header="_染色机管理" FontSize="16" Click="MAC_SET"/>
@ -40,10 +42,16 @@
<MenuItem Header="_历史查询" FontSize="16"/> <MenuItem Header="_历史查询" FontSize="16"/>
<MenuItem Header="_统计" FontSize="16"/> <MenuItem Header="_统计" FontSize="16"/>
</MenuItem> </MenuItem>
<MenuItem Header="_帮助" FontSize="16" Focusable ="False">
<MenuItem Header="_帮助" FontSize="16" Click="HELP"/>
</MenuItem>
</Menu> </Menu>
<TextBox x:Name="USERTIME" HorizontalAlignment="Right" Height="30" Margin="0,0,5,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="14" <TextBox x:Name="USERTIME" HorizontalAlignment="Right" Height="30" Margin="0,0,5,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="14"
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False"/> Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False"/>
<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"/>
<Button Content="新工单" HorizontalAlignment="Left" Margin="335,35,0,0" Height="30" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" FontSize="20" Click="Button_NewOrder" Focusable ="False"/> <Button Content="新工单" HorizontalAlignment="Left" Margin="335,35,0,0" Height="30" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" FontSize="20" Click="Button_NewOrder" Focusable ="False"/>
<Button Content="归属订单" HorizontalAlignment="Left" Margin="300,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology"/> <Button Content="归属订单" HorizontalAlignment="Left" Margin="300,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology"/>

3
MainWindow.xaml.cs

@ -28,6 +28,7 @@ namespace formula_manage
/// </summary> /// </summary>
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
DataTable STUFFdataTable = new DataTable(); //建立STUFF缓存 DataTable STUFFdataTable = new DataTable(); //建立STUFF缓存
public MainWindow() public MainWindow()
@ -38,6 +39,8 @@ namespace formula_manage
InitializeComponent(); InitializeComponent();
this.Closing += Window_Closing; //添加窗口关闭事件 this.Closing += Window_Closing; //添加窗口关闭事件
USER.Text = App.USER_Purview;
CountDown();//执行循环方法 CountDown();//执行循环方法
DataTable dataTable = new DataTable(); DataTable dataTable = new DataTable();

Loading…
Cancel
Save