diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx b/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
deleted file mode 100644
index 7c37fe8..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx b/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
deleted file mode 100644
index 7c37fe8..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx b/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
deleted file mode 100644
index 3a88d11..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx b/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
deleted file mode 100644
index 7c37fe8..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx b/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
deleted file mode 100644
index 3a88d11..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo
index 0f5aea6..b0f2ffe 100644
--- a/.vs/SubCabinetSolution/v17/.suo
+++ b/.vs/SubCabinetSolution/v17/.suo
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx b/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
deleted file mode 100644
index 7c37fe8..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx b/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
deleted file mode 100644
index 3a88d11..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo
index 0f5aea6..b0f2ffe 100644
--- a/.vs/SubCabinetSolution/v17/.suo
+++ b/.vs/SubCabinetSolution/v17/.suo
Binary files differ
diff --git a/SubCabinetSolution/MainWindow.xaml b/SubCabinetSolution/MainWindow.xaml
index 08efcab..324429a 100644
--- a/SubCabinetSolution/MainWindow.xaml
+++ b/SubCabinetSolution/MainWindow.xaml
@@ -112,7 +112,8 @@
Grid.Row="3"
Style="{StaticResource UserDefineButtonStyle}"
Content="登录"
- Command="{Binding LoginToMainCommand}" />
+ Command="{Binding LoginToMainCommand }"
+ CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
+ Command="{Binding LoginToMainCommand }"
+ CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
+ Command="{Binding LoginToMainCommand }"
+ CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
+
+ CabinetWindow.xaml
+
MSBuild:Compile
Designer
@@ -186,6 +189,7 @@
MainWindow.xaml
Code
+
@@ -210,9 +214,6 @@
Always
-
-
-
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx b/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
deleted file mode 100644
index 7c37fe8..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx b/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
deleted file mode 100644
index 3a88d11..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo
index 0f5aea6..b0f2ffe 100644
--- a/.vs/SubCabinetSolution/v17/.suo
+++ b/.vs/SubCabinetSolution/v17/.suo
Binary files differ
diff --git a/SubCabinetSolution/MainWindow.xaml b/SubCabinetSolution/MainWindow.xaml
index 08efcab..324429a 100644
--- a/SubCabinetSolution/MainWindow.xaml
+++ b/SubCabinetSolution/MainWindow.xaml
@@ -112,7 +112,8 @@
Grid.Row="3"
Style="{StaticResource UserDefineButtonStyle}"
Content="登录"
- Command="{Binding LoginToMainCommand}" />
+ Command="{Binding LoginToMainCommand }"
+ CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
+
+ CabinetWindow.xaml
+
MSBuild:Compile
Designer
@@ -186,6 +189,7 @@
MainWindow.xaml
Code
+
@@ -210,9 +214,6 @@
Always
-
-
-
diff --git a/SubCabinetSolution/ViewModel/MainViewModel.cs b/SubCabinetSolution/ViewModel/MainViewModel.cs
index 67a6f63..8652ecb 100644
--- a/SubCabinetSolution/ViewModel/MainViewModel.cs
+++ b/SubCabinetSolution/ViewModel/MainViewModel.cs
@@ -1,10 +1,10 @@
using System.Data;
-using System.Diagnostics;
using System.Windows;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using MySql.Data.MySqlClient;
using SubCabinetSolution.Utils;
+using SubCabinetSolution.Views;
namespace SubCabinetSolution.ViewModel
{
@@ -40,7 +40,7 @@
}
}
- public RelayCommand LoginToMainCommand { get; set; }
+ public RelayCommand LoginToMainCommand { get; set; }
public string VersionName { get; set; }
private MySqlConnection connection;
@@ -51,11 +51,11 @@
public MainViewModel()
{
this.connection = DataBaseManager.GetInstance().GetConnection();
- this.LoginToMainCommand = new RelayCommand(Login);
+ this.LoginToMainCommand = new RelayCommand(Login);
this.VersionName = "版本号 Ver " + Application.ResourceAssembly.GetName().Version;
}
- private void Login()
+ private void Login(Window window)
{
if (string.IsNullOrWhiteSpace(userName))
{
@@ -84,10 +84,12 @@
{
string account = reader.GetString("ACCOUNT");
string secretKey = reader.GetString("PASSWORD"); //被加盐之后的密码
- // 解码得到密码
+ // TODO 解码得到密码
if (account != userName || secretKey != userPassword) continue;
- MessageBox.Show("登录成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
reader.Close();
+ CabinetWindow cabinetWindow = new CabinetWindow();
+ cabinetWindow.Show();
+ window.Close();
return;
}
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx b/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
deleted file mode 100644
index 7c37fe8..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx b/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
deleted file mode 100644
index 3a88d11..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo
index 0f5aea6..b0f2ffe 100644
--- a/.vs/SubCabinetSolution/v17/.suo
+++ b/.vs/SubCabinetSolution/v17/.suo
Binary files differ
diff --git a/SubCabinetSolution/MainWindow.xaml b/SubCabinetSolution/MainWindow.xaml
index 08efcab..324429a 100644
--- a/SubCabinetSolution/MainWindow.xaml
+++ b/SubCabinetSolution/MainWindow.xaml
@@ -112,7 +112,8 @@
Grid.Row="3"
Style="{StaticResource UserDefineButtonStyle}"
Content="登录"
- Command="{Binding LoginToMainCommand}" />
+ Command="{Binding LoginToMainCommand }"
+ CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
+
+ CabinetWindow.xaml
+
MSBuild:Compile
Designer
@@ -186,6 +189,7 @@
MainWindow.xaml
Code
+
@@ -210,9 +214,6 @@
Always
-
-
-
diff --git a/SubCabinetSolution/ViewModel/MainViewModel.cs b/SubCabinetSolution/ViewModel/MainViewModel.cs
index 67a6f63..8652ecb 100644
--- a/SubCabinetSolution/ViewModel/MainViewModel.cs
+++ b/SubCabinetSolution/ViewModel/MainViewModel.cs
@@ -1,10 +1,10 @@
using System.Data;
-using System.Diagnostics;
using System.Windows;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using MySql.Data.MySqlClient;
using SubCabinetSolution.Utils;
+using SubCabinetSolution.Views;
namespace SubCabinetSolution.ViewModel
{
@@ -40,7 +40,7 @@
}
}
- public RelayCommand LoginToMainCommand { get; set; }
+ public RelayCommand LoginToMainCommand { get; set; }
public string VersionName { get; set; }
private MySqlConnection connection;
@@ -51,11 +51,11 @@
public MainViewModel()
{
this.connection = DataBaseManager.GetInstance().GetConnection();
- this.LoginToMainCommand = new RelayCommand(Login);
+ this.LoginToMainCommand = new RelayCommand(Login);
this.VersionName = "版本号 Ver " + Application.ResourceAssembly.GetName().Version;
}
- private void Login()
+ private void Login(Window window)
{
if (string.IsNullOrWhiteSpace(userName))
{
@@ -84,10 +84,12 @@
{
string account = reader.GetString("ACCOUNT");
string secretKey = reader.GetString("PASSWORD"); //被加盐之后的密码
- // 解码得到密码
+ // TODO 解码得到密码
if (account != userName || secretKey != userPassword) continue;
- MessageBox.Show("登录成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
reader.Close();
+ CabinetWindow cabinetWindow = new CabinetWindow();
+ cabinetWindow.Show();
+ window.Close();
return;
}
diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml b/SubCabinetSolution/Views/CabinetWindow.xaml
new file mode 100644
index 0000000..1d1c229
--- /dev/null
+++ b/SubCabinetSolution/Views/CabinetWindow.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx b/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
deleted file mode 100644
index 7c37fe8..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx b/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
deleted file mode 100644
index 3a88d11..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo
index 0f5aea6..b0f2ffe 100644
--- a/.vs/SubCabinetSolution/v17/.suo
+++ b/.vs/SubCabinetSolution/v17/.suo
Binary files differ
diff --git a/SubCabinetSolution/MainWindow.xaml b/SubCabinetSolution/MainWindow.xaml
index 08efcab..324429a 100644
--- a/SubCabinetSolution/MainWindow.xaml
+++ b/SubCabinetSolution/MainWindow.xaml
@@ -112,7 +112,8 @@
Grid.Row="3"
Style="{StaticResource UserDefineButtonStyle}"
Content="登录"
- Command="{Binding LoginToMainCommand}" />
+ Command="{Binding LoginToMainCommand }"
+ CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
+
+ CabinetWindow.xaml
+
MSBuild:Compile
Designer
@@ -186,6 +189,7 @@
MainWindow.xaml
Code
+
@@ -210,9 +214,6 @@
Always
-
-
-
diff --git a/SubCabinetSolution/ViewModel/MainViewModel.cs b/SubCabinetSolution/ViewModel/MainViewModel.cs
index 67a6f63..8652ecb 100644
--- a/SubCabinetSolution/ViewModel/MainViewModel.cs
+++ b/SubCabinetSolution/ViewModel/MainViewModel.cs
@@ -1,10 +1,10 @@
using System.Data;
-using System.Diagnostics;
using System.Windows;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using MySql.Data.MySqlClient;
using SubCabinetSolution.Utils;
+using SubCabinetSolution.Views;
namespace SubCabinetSolution.ViewModel
{
@@ -40,7 +40,7 @@
}
}
- public RelayCommand LoginToMainCommand { get; set; }
+ public RelayCommand LoginToMainCommand { get; set; }
public string VersionName { get; set; }
private MySqlConnection connection;
@@ -51,11 +51,11 @@
public MainViewModel()
{
this.connection = DataBaseManager.GetInstance().GetConnection();
- this.LoginToMainCommand = new RelayCommand(Login);
+ this.LoginToMainCommand = new RelayCommand(Login);
this.VersionName = "版本号 Ver " + Application.ResourceAssembly.GetName().Version;
}
- private void Login()
+ private void Login(Window window)
{
if (string.IsNullOrWhiteSpace(userName))
{
@@ -84,10 +84,12 @@
{
string account = reader.GetString("ACCOUNT");
string secretKey = reader.GetString("PASSWORD"); //被加盐之后的密码
- // 解码得到密码
+ // TODO 解码得到密码
if (account != userName || secretKey != userPassword) continue;
- MessageBox.Show("登录成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
reader.Close();
+ CabinetWindow cabinetWindow = new CabinetWindow();
+ cabinetWindow.Show();
+ window.Close();
return;
}
diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml b/SubCabinetSolution/Views/CabinetWindow.xaml
new file mode 100644
index 0000000..1d1c229
--- /dev/null
+++ b/SubCabinetSolution/Views/CabinetWindow.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml.cs b/SubCabinetSolution/Views/CabinetWindow.xaml.cs
new file mode 100644
index 0000000..15b5fa4
--- /dev/null
+++ b/SubCabinetSolution/Views/CabinetWindow.xaml.cs
@@ -0,0 +1,12 @@
+using System.Windows;
+
+namespace SubCabinetSolution.Views
+{
+ public partial class CabinetWindow : Window
+ {
+ public CabinetWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
new file mode 100644
index 0000000..8ddc910
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/171fb31f-2ef0-453c-8448-3785b86fdece.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
new file mode 100644
index 0000000..606169c
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/3dfbcdc0-84b8-4cc6-ba62-316f02edef98.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
new file mode 100644
index 0000000..402661f
--- /dev/null
+++ b/.vs/SubCabinetSolution/FileContentIndex/4280b873-f057-4cc1-988d-044745c5ab9f.vsidx
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx b/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
deleted file mode 100644
index 5c61392..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/8ce3bcd5-2fdb-4151-a4a8-35cef80a5d18.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx b/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
deleted file mode 100644
index 7c37fe8..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/9df6f22f-54c1-4025-9eb0-22f93083c500.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx b/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
deleted file mode 100644
index 3a88d11..0000000
--- a/.vs/SubCabinetSolution/FileContentIndex/d1c96c45-6c51-4d35-80c0-eb2b9c43ed44.vsidx
+++ /dev/null
Binary files differ
diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo
index 0f5aea6..b0f2ffe 100644
--- a/.vs/SubCabinetSolution/v17/.suo
+++ b/.vs/SubCabinetSolution/v17/.suo
Binary files differ
diff --git a/SubCabinetSolution/MainWindow.xaml b/SubCabinetSolution/MainWindow.xaml
index 08efcab..324429a 100644
--- a/SubCabinetSolution/MainWindow.xaml
+++ b/SubCabinetSolution/MainWindow.xaml
@@ -112,7 +112,8 @@
Grid.Row="3"
Style="{StaticResource UserDefineButtonStyle}"
Content="登录"
- Command="{Binding LoginToMainCommand}" />
+ Command="{Binding LoginToMainCommand }"
+ CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
+
+ CabinetWindow.xaml
+
MSBuild:Compile
Designer
@@ -186,6 +189,7 @@
MainWindow.xaml
Code
+
@@ -210,9 +214,6 @@
Always
-
-
-
diff --git a/SubCabinetSolution/ViewModel/MainViewModel.cs b/SubCabinetSolution/ViewModel/MainViewModel.cs
index 67a6f63..8652ecb 100644
--- a/SubCabinetSolution/ViewModel/MainViewModel.cs
+++ b/SubCabinetSolution/ViewModel/MainViewModel.cs
@@ -1,10 +1,10 @@
using System.Data;
-using System.Diagnostics;
using System.Windows;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using MySql.Data.MySqlClient;
using SubCabinetSolution.Utils;
+using SubCabinetSolution.Views;
namespace SubCabinetSolution.ViewModel
{
@@ -40,7 +40,7 @@
}
}
- public RelayCommand LoginToMainCommand { get; set; }
+ public RelayCommand LoginToMainCommand { get; set; }
public string VersionName { get; set; }
private MySqlConnection connection;
@@ -51,11 +51,11 @@
public MainViewModel()
{
this.connection = DataBaseManager.GetInstance().GetConnection();
- this.LoginToMainCommand = new RelayCommand(Login);
+ this.LoginToMainCommand = new RelayCommand(Login);
this.VersionName = "版本号 Ver " + Application.ResourceAssembly.GetName().Version;
}
- private void Login()
+ private void Login(Window window)
{
if (string.IsNullOrWhiteSpace(userName))
{
@@ -84,10 +84,12 @@
{
string account = reader.GetString("ACCOUNT");
string secretKey = reader.GetString("PASSWORD"); //被加盐之后的密码
- // 解码得到密码
+ // TODO 解码得到密码
if (account != userName || secretKey != userPassword) continue;
- MessageBox.Show("登录成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
reader.Close();
+ CabinetWindow cabinetWindow = new CabinetWindow();
+ cabinetWindow.Show();
+ window.Close();
return;
}
diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml b/SubCabinetSolution/Views/CabinetWindow.xaml
new file mode 100644
index 0000000..1d1c229
--- /dev/null
+++ b/SubCabinetSolution/Views/CabinetWindow.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml.cs b/SubCabinetSolution/Views/CabinetWindow.xaml.cs
new file mode 100644
index 0000000..15b5fa4
--- /dev/null
+++ b/SubCabinetSolution/Views/CabinetWindow.xaml.cs
@@ -0,0 +1,12 @@
+using System.Windows;
+
+namespace SubCabinetSolution.Views
+{
+ public partial class CabinetWindow : Window
+ {
+ public CabinetWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/SubCabinetSolution/obj/Debug/MainWindow.g.i.cs b/SubCabinetSolution/obj/Debug/MainWindow.g.i.cs
index 1049182..3b10704 100644
--- a/SubCabinetSolution/obj/Debug/MainWindow.g.i.cs
+++ b/SubCabinetSolution/obj/Debug/MainWindow.g.i.cs
@@ -1,4 +1,4 @@
-#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "941D14BDE8C1FEDF1E553BDD8455E9C74D566E7A69DB806B788CC462333E20DF"
+#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1D496B6522411637705419608CEBC6036ABF51144BE618385723D3B61C75472A"
//------------------------------------------------------------------------------
//
// 此代码由工具生成。