sc 4 years ago
parent
commit
4ef4fff95d
  1. 9
      Audit.csproj
  2. 6
      Windows/LogWindow.xaml
  3. 23
      Windows/LogWindow.xaml.cs
  4. 12
      Windows/Set_up.xaml
  5. 28
      Windows/Set_up.xaml.cs

9
Audit.csproj

@ -137,6 +137,9 @@
<Compile Include="Windows\LogWindow.xaml.cs">
<DependentUpon>LogWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\Set_up.xaml.cs">
<DependentUpon>Set_up.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -153,6 +156,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\Set_up.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@ -172,8 +179,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Audit_1_TemporaryKey.pfx" />
<None Include="Audit_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">

6
Windows/LogWindow.xaml

@ -12,8 +12,8 @@
<TextBlock HorizontalAlignment="Left" Height="25" Margin="55,50,0,0" TextWrapping="Wrap" Text="用户" VerticalAlignment="Top" Width="35" FontSize="16"/>
<TextBlock HorizontalAlignment="Left" Height="25" Margin="55,80,0,0" TextWrapping="Wrap" Text="密码" VerticalAlignment="Top" Width="35" FontSize="16"/>
<Button HorizontalAlignment="Left" Height="35" Margin="60,110,0,0" VerticalAlignment="Top" Content="登录" Width="75" Click="Log" FontSize="16"/>
<Button HorizontalAlignment="Left" Height="35" Margin="165,110,0,0" VerticalAlignment="Top" Content="取消" Width="75" Click="exit" FontSize="16"/>
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,50,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" Text="{Binding AuditData.Instance.UserAccount.UserCode}"/>
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,80,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" Text="{Binding AuditData.Instance.UserAccount.PassWord}"/>
<Button HorizontalAlignment="Left" Height="35" Margin="165,110,0,0" VerticalAlignment="Top" Content="取消" Width="75" Click="Exit" FontSize="16"/>
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,50,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" Text="{Binding AuditData.Instance.UserAccount.UserCode}" x:Name="users"/>
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,80,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" Text="{Binding AuditData.Instance.UserAccount.PassWord}" x:Name="Passwds"/>
</Grid>
</mah:MetroWindow>

23
Windows/LogWindow.xaml.cs

@ -25,14 +25,33 @@ namespace Audit.Windows
InitializeComponent();
}
private void exit(object sender, RoutedEventArgs e)//退出按钮
private void Exit(object sender, RoutedEventArgs e)//退出按钮
{
Application.Current.Shutdown();//关闭程序窗口
}
private void Log(object sender, RoutedEventArgs e)//登录按钮
{
string user = this.users.Text;
string passwd = this.Passwds.Text;
if (user == "engineer")
{
if (passwd == "engineer")
{
MessageBox.Show("警告:设置模式将会对本机运行造成重大影响,请您明确操作目的及可能需承担的后果");
Windows.Set_up steup = new Windows.Set_up();
steup.Show();
this.Close();
}
else
{
MessageBox.Show("错误01:错误的认证信息");
}
}
else
{
}
}
}
}

12
Windows/Set_up.xaml

@ -0,0 +1,12 @@
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" x:Class="Audit.Windows.Set_up"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Audit.Windows"
mc:Ignorable="d"
Title="设置" Height="600" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
<Grid>
</Grid>
</mah:MetroWindow>

28
Windows/Set_up.xaml.cs

@ -0,0 +1,28 @@
using MahApps.Metro.Controls;
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.Shapes;
namespace Audit.Windows
{
/// <summary>
/// Set_up.xaml 的交互逻辑
/// </summary>
public partial class Set_up : MetroWindow
{
public Set_up()
{
InitializeComponent();
}
}
}
Loading…
Cancel
Save