diff --git a/SunlightCentralizedControlManagement_SCCM_.csproj b/SunlightCentralizedControlManagement_SCCM_.csproj
index 0a74b87..5c763c6 100644
--- a/SunlightCentralizedControlManagement_SCCM_.csproj
+++ b/SunlightCentralizedControlManagement_SCCM_.csproj
@@ -150,6 +150,9 @@
DispenseMacInfo.xaml
+
+ UserInf.xaml
+
UserInformation.xaml
@@ -289,6 +292,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
Designer
MSBuild:Compile
@@ -525,6 +532,11 @@
+
+
+
+
+
diff --git a/View/MonitorView.xaml.cs b/View/MonitorView.xaml.cs
index 4753ca9..5a5a675 100644
--- a/View/MonitorView.xaml.cs
+++ b/View/MonitorView.xaml.cs
@@ -142,68 +142,74 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
private void MenuItem_LOCK_XML(object sender, RoutedEventArgs e)
{
- bool mode = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First().Field("LOCK");
+ if (!string.IsNullOrEmpty(machine))
+ {
+ bool mode = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First().Field("LOCK");
- Dictionary dat_ = new Dictionary();
- dat_.Clear();
+ Dictionary dat_ = new Dictionary();
+ dat_.Clear();
- if (!mode)
- {
- dat_.Add("NAME", "LOCK");
- dat_.Add("VALUE", "True");
- MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "True");
- }
- else
- {
- dat_.Add("NAME", "LOCK");
- dat_.Add("VALUE", "False");
- MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "False");
- }
+ if (!mode)
+ {
+ dat_.Add("NAME", "LOCK");
+ dat_.Add("VALUE", "True");
+ MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "True");
+ }
+ else
+ {
+ dat_.Add("NAME", "LOCK");
+ dat_.Add("VALUE", "False");
+ MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "False");
+ }
- DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
- int index = Convert.ToInt16(drEmployee.Field