Merge branch 'master' of http://192.168.0.12:13000/sc/Audit_APP
This commit is contained in:
commit
9ede634f3c
115 files changed
+2666
-7523
No files matched your search
+19
-12
@@ -7,23 +7,30 @@
|
||||
mc:Ignorable="d"
|
||||
Title="设置" Height="600" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<Button Content="BD连接测试" HorizontalAlignment="Left" Height="35" Margin="135,285,0,0" VerticalAlignment="Top" Width="105" x:Name="BDtset" FontSize="15"/>
|
||||
<Button Content="TI连接测试" HorizontalAlignment="Left" Height="35" Margin="350,285,0,0" VerticalAlignment="Top" Width="105" x:Name="TItset" FontSize="15"/>
|
||||
<Button Content="BD连接测试" HorizontalAlignment="Left" Height="35" Margin="135,225,0,0" VerticalAlignment="Top" Width="105" x:Name="BDtset" FontSize="15"/>
|
||||
<Button Content="TI连接测试" HorizontalAlignment="Left" Height="35" Margin="350,225,0,0" VerticalAlignment="Top" Width="105" x:Name="TItset" FontSize="15"/>
|
||||
<Button Content="退出" HorizontalAlignment="Left" Height="40" Margin="625,505,0,0" VerticalAlignment="Top" Width="120" x:Name="SetExit" FontSize="20" Click="SetExit_Click"/>
|
||||
<Button Content="保存" HorizontalAlignment="Left" Height="40" Margin="455,505,0,0" VerticalAlignment="Top" Width="120" x:Name="Save" FontSize="20"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="135,70,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="135,120,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="135,170,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="350,70,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="350,120,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="350,170,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="135,220,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="350,220,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205"/>
|
||||
<Button Content="保存" HorizontalAlignment="Left" Height="40" Margin="455,505,0,0" VerticalAlignment="Top" Width="120" x:Name="Save" FontSize="20" Click="Save_Click"/>
|
||||
<TextBox x:Name="DBCSQL" HorizontalAlignment="Left" Height="40" Margin="135,70,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205" FontSize="20"/>
|
||||
<TextBox x:Name="DBCID" HorizontalAlignment="Left" Height="40" Margin="135,120,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205" FontSize="20"/>
|
||||
<TextBox x:Name="DBCPW" HorizontalAlignment="Left" Height="40" Margin="135,170,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205" FontSize="20"/>
|
||||
<TextBox x:Name="TISQL" HorizontalAlignment="Left" Height="40" Margin="350,70,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205" FontSize="20"/>
|
||||
<TextBox x:Name="TIID" HorizontalAlignment="Left" Height="40" Margin="350,120,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205" FontSize="20"/>
|
||||
<TextBox x:Name="TIPW" HorizontalAlignment="Left" Height="40" Margin="350,170,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="205" FontSize="20"/>
|
||||
<TextBox x:Name="time1" HorizontalAlignment="Left" Height="40" Margin="135,320,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<TextBox x:Name="time2" HorizontalAlignment="Left" Height="40" Margin="250,320,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<TextBox x:Name="time3" HorizontalAlignment="Left" Height="40" Margin="365,320,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<TextBox x:Name="time4" HorizontalAlignment="Left" Height="40" Margin="135,370,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<TextBox x:Name="time5" HorizontalAlignment="Left" Height="40" Margin="250,370,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<TextBox x:Name="time6" HorizontalAlignment="Left" Height="40" Margin="365,370,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<TextBox x:Name="time7" HorizontalAlignment="Left" Height="40" Margin="135,420,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<TextBox x:Name="time8" HorizontalAlignment="Left" Height="40" Margin="250,420,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<TextBox x:Name="time9" HorizontalAlignment="Left" Height="40" Margin="365,420,0,0" TextWrapping="Wrap" Text="0:00:00" VerticalAlignment="Top" Width="100" FontSize="20"/>
|
||||
<Label Content="BatchDyeingCentral" HorizontalAlignment="Left" Height="40" Margin="135,25,0,0" VerticalAlignment="Top" Width="215" FontSize="20"/>
|
||||
<Label Content="预设时间" HorizontalAlignment="Left" Height="40" Margin="135,275,0,0" VerticalAlignment="Top" Width="215" FontSize="20"/>
|
||||
<Label Content="Ticket" HorizontalAlignment="Left" Height="40" Margin="350,25,0,0" VerticalAlignment="Top" Width="130" FontSize="20"/>
|
||||
<Label Content="SQL路径:" HorizontalAlignment="Left" Height="40" Margin="10,70,0,0" VerticalAlignment="Top" Width="120" FontSize="20"/>
|
||||
<Label Content="SQL账号:" HorizontalAlignment="Left" Height="40" Margin="10,120,0,0" VerticalAlignment="Top" Width="120" FontSize="20"/>
|
||||
<Label Content="SQL密码:" HorizontalAlignment="Left" Height="40" Margin="10,170,0,0" VerticalAlignment="Top" Width="120" FontSize="20"/>
|
||||
<Label Content="更新时间:" HorizontalAlignment="Left" Height="40" Margin="10,220,0,0" VerticalAlignment="Top" Width="120" FontSize="20"/>
|
||||
</Grid>
|
||||
</mah:MetroWindow>
|
||||
@@ -12,6 +12,8 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.IO;
|
||||
using Audit.ViewModel;
|
||||
|
||||
namespace Audit.Windows
|
||||
{
|
||||
@@ -20,19 +22,113 @@ namespace Audit.Windows
|
||||
/// </summary>
|
||||
public partial class Set_up_Sql : MetroWindow
|
||||
{
|
||||
ReadIni readini = new ReadIni();
|
||||
string filePath = "" + System.Environment.CurrentDirectory + "\\config_Audit.ini";//获取当前文件目录
|
||||
string logPath = "" + System.Environment.CurrentDirectory + "\\Log\\AuditLog.txt";//日志文件
|
||||
string Log_time = "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]:";
|
||||
|
||||
///<Summary>
|
||||
/// Set_up
|
||||
///</Summary>
|
||||
public Set_up_Sql()
|
||||
{
|
||||
InitializeComponent();
|
||||
SQL();
|
||||
}
|
||||
|
||||
public void SQL()
|
||||
{
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
MessageBoxResult config = System.Windows.MessageBox.Show("未发现配置信息是否创建新的配置信息", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes);//弹窗提示是否创建配置信息
|
||||
if (config == MessageBoxResult.Yes)
|
||||
{
|
||||
ReadIni.WriteData("Database", "BatchDyeingCentral_SQL", ".\\express", filePath);//创建配置信息
|
||||
ReadIni.WriteData("Database", "BatchDyeingCentral_NAME", "sa", filePath);
|
||||
ReadIni.WriteData("Database", "BatchDyeingCentral_PW", "sunlight", filePath);
|
||||
ReadIni.WriteData("Database", "Ticket_SQL", ".\\express", filePath);
|
||||
ReadIni.WriteData("Database", "Ticket_NAME", "sa", filePath);
|
||||
ReadIni.WriteData("Database", "Ticket_PW", "sunlight", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT1", "", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT2", "", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT3", "", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT4", "", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT5", "", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT6", "", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT7", "", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT8", "", filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT9", "", filePath);
|
||||
FileStream fs = new FileStream(logPath, FileMode.Append, FileAccess.Write);
|
||||
StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
wr.WriteLine(Log_time + "Audit创建配置信息文件");
|
||||
wr.Close();//写入配置文件
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.DBCSQL.Text = ReadIni.ReadIniData("Database", "BatchDyeingCentral_SQL", "***", filePath);//读取配置信息
|
||||
this.DBCID.Text = ReadIni.ReadIniData("Database", "BatchDyeingCentral_NAME", "***", filePath);
|
||||
this.DBCPW.Text = ReadIni.ReadIniData("Database", "BatchDyeingCentral_PW", "***", filePath);
|
||||
this.TISQL.Text = ReadIni.ReadIniData("Database", "Ticket_SQL", "***", filePath);
|
||||
this.TIID.Text = ReadIni.ReadIniData("Database", "Ticket_NAME", "***", filePath);
|
||||
this.TIPW.Text = ReadIni.ReadIniData("Database", "Ticket_PW", "***", filePath);
|
||||
this.time1.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT1", "", filePath);
|
||||
this.time2.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT2", "", filePath);
|
||||
this.time3.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT3", "", filePath);
|
||||
this.time4.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT4", "", filePath);
|
||||
this.time5.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT5", "", filePath);
|
||||
this.time6.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT6", "", filePath);
|
||||
this.time7.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT7", "", filePath);
|
||||
this.time8.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT8", "", filePath);
|
||||
this.time9.Text = ReadIni.ReadIniData("WORKER TIME", "WORKERT9", "", filePath);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetExit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Windows.LogWindow logWindow = new Windows.LogWindow();
|
||||
logWindow.Show();//实例化并打开登录窗口
|
||||
this.Close();//关闭当前窗口
|
||||
}
|
||||
|
||||
private void Save_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FileStream fs = new FileStream(logPath, FileMode.Append, FileAccess.Write);
|
||||
StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
int DBCSQL = ReadIni.WriteData("Database", "BatchDyeingCentral_SQL", this.DBCSQL.Text, filePath);//修改配置文件
|
||||
int DBCID = ReadIni.WriteData("Database", "BatchDyeingCentral_NAME", this.DBCID.Text, filePath);
|
||||
int DBCWP = ReadIni.WriteData("Database", "BatchDyeingCentral_PW", this.DBCPW.Text, filePath);
|
||||
int TISQL = ReadIni.WriteData("Database", "Ticket_SQL", this.TISQL.Text, filePath);
|
||||
int TIID = ReadIni.WriteData("Database", "Ticket_NAME", this.TIID.Text, filePath);
|
||||
int TIWP = ReadIni.WriteData("Database", "Ticket_PW", this.TIPW.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT1", this.time1.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT2", this.time2.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT3", this.time3.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT4", this.time4.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT5", this.time5.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT6", this.time6.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT7", this.time7.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT8", this.time8.Text, filePath);
|
||||
ReadIni.WriteData("WORKER TIME", "WORKERT9", this.time9.Text, filePath);
|
||||
if (DBCSQL == 0 && DBCID == 0 && DBCWP == 0)
|
||||
{
|
||||
wr.WriteLine(Log_time + "BatchDyeingCentral配置修改失败");
|
||||
wr.Close();//写入配置文件
|
||||
MessageBox.Show("BatchDyeingCentral配置保存失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TISQL == 0 && TIID == 0 && TIWP == 0)
|
||||
{
|
||||
wr.WriteLine(Log_time + "Ticket配置修改失败");
|
||||
wr.Close();//写入配置文件
|
||||
MessageBox.Show("Ticket配置保存失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
wr.WriteLine(Log_time + "Audit修改配置信息文件");
|
||||
wr.Close();//写入配置文件
|
||||
MessageBox.Show("保存完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<Window x:Class="Audit.Windows.user"
|
||||
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="200" Width="300" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<TextBlock HorizontalAlignment="Left" Height="25" Margin="55,30,0,0" TextWrapping="Wrap" Text="用户" VerticalAlignment="Top" Width="35" FontSize="16"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="25" Margin="55,60,0,0" TextWrapping="Wrap" Text="密码" VerticalAlignment="Top" Width="35" FontSize="16"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="25" Margin="55,130,0,0" TextWrapping="Wrap" Text="时间" VerticalAlignment="Top" Width="35" FontSize="16"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,130,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" x:Name="userst" IsTabStop="True"
|
||||
BorderBrush="{x:Null}" Text="600" InputMethod.IsInputMethodEnabled="False" />
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,30,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" x:Name="users" IsTabStop="True"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,60,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" x:Name="Passwds" IsTabStop="True"/>
|
||||
<Button HorizontalAlignment="Left" Height="35" Margin="60,90,0,0" VerticalAlignment="Top" Content="登录" Width="75" Click="Log" FontSize="16"/>
|
||||
<Button HorizontalAlignment="Left" Height="35" Margin="165,90,0,0" VerticalAlignment="Top" Content="取消" Width="75" Click="Exit" FontSize="16"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
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.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Audit.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// user.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class user : Window
|
||||
{
|
||||
string logPath = "" + System.Environment.CurrentDirectory + "\\Log\\AuditLog.txt";//日志文件
|
||||
string Log_time = "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]:";
|
||||
|
||||
public user()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Imitnumber(object sender, TextCompositionEventArgs e)//输入框对象限制
|
||||
{
|
||||
Regex re = new Regex("[^0-9]+");
|
||||
e.Handled = re.IsMatch(e.Text);
|
||||
}
|
||||
|
||||
private void Exit(object sender, RoutedEventArgs e)//退出按钮
|
||||
{
|
||||
this.Close();//关闭当前窗口
|
||||
}
|
||||
|
||||
private void Log(object sender, RoutedEventArgs e)//登录按钮
|
||||
{
|
||||
|
||||
string users = this.users.Text;
|
||||
string Passwds = this.Passwds.Text;
|
||||
FileStream fs = new FileStream(logPath, FileMode.Append, FileAccess.Write);
|
||||
StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
if ((users == "sunlight") || (users == "SUNLIGHT"))//内置账号
|
||||
{
|
||||
if ((Passwds == "sunlight") || (users == "SUNLIGHT"))//主页面判断
|
||||
{
|
||||
Audit.MainWindow.user_t = int.Parse(this.userst.Text);
|
||||
Audit.MainWindow.user_n = "SUNLIGHT";
|
||||
this.Close();//关闭当前窗口
|
||||
wr.WriteLine(Log_time + "SUNLIGHT账号登录[" + this.userst.Text + "]");
|
||||
wr.Close();//写入配置文件
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("ERR.C0001:拒绝登录", "错误");//设置密码错误
|
||||
wr.WriteLine(Log_time + "拒绝登录");
|
||||
wr.Close();//写入配置文件
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("ERR.C0001:拒绝登录", "错误");//设置密码错误
|
||||
wr.WriteLine(Log_time + "拒绝登录");
|
||||
wr.Close();//写入配置文件
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user