xiongzhu 5 anos atrás
pai
commit
6d6c80c2c2
2 arquivos alterados com 12 adições e 0 exclusões
  1. 1 0
      views/MainWindow.xaml
  2. 11 0
      views/MainWindow.xaml.cs

+ 1 - 0
views/MainWindow.xaml

@@ -25,6 +25,7 @@
             <Separator Margin="20 0 10 0" Width="1" Height="14" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"></Separator>
             <Button Content="设置开机自启" Width="80" Height="25" Margin="10 0 0 0"></Button>
             <Button Content="设置定时重启" Width="80" Height="25" Margin="10 0 0 0"></Button>
+            <Button Content="get event" Width="80" Height="25" Margin="10 0 0 0" Click="Get_Event_Click"></Button>
         </StackPanel>
         <ListView x:Name="lv_device" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Height="Auto" HorizontalAlignment="Stretch">
             <ListView.View>

+ 11 - 0
views/MainWindow.xaml.cs

@@ -541,5 +541,16 @@ namespace DeviceCenter
             string time = $"{struCFG.struTime.dwYear:D4}-{struCFG.struTime.dwMonth:D2}-{struCFG.struTime.dwDay:D4} {struCFG.struTime.dwHour:D2}:{struCFG.struTime.dwMinute:D2}:{struCFG.struTime.dwSecond:D2}";
             log.Info($"receive acs event employNo:{employNo} cardNo:{cardNo} time:{time}");
         }
+
+        private void Get_Event_Click(object sender, RoutedEventArgs e)
+        {
+            foreach (Device device in devices)
+            {
+                if (device.status == DeviceStatus.CONNECTED && device.type == DeviceType.ACS)
+                {
+                    getEvent(((AcsDevice)device).userId);
+                }
+            }
+        }
     }
 }