108 lines
3.4 KiB
C#
108 lines
3.4 KiB
C#
using HandyControl.Tools.Extension;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
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 SafeBagDE70.Admin
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for AdminWindow.xaml
|
|
/// </summary>
|
|
public partial class AdminWindow : HandyControl.Controls.Window
|
|
{
|
|
LogViewerUC loguc;
|
|
AdminConfigurationUC configuration;
|
|
UserManageUC userManage;
|
|
AdminSettingsUC settings;
|
|
public AdminWindow()
|
|
{
|
|
InitializeComponent();
|
|
loguc= new LogViewerUC();
|
|
configuration = new AdminConfigurationUC();
|
|
userManage=new UserManageUC();
|
|
settings = new AdminSettingsUC();
|
|
this.MainContentControl.Content = loguc;
|
|
this.Loaded += AdminWindow_Loaded;
|
|
}
|
|
|
|
private void AdminWindow_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
lblCDMStatus.DataContext = AppData.CDMSTATE;
|
|
lblDeviceStatus.DataContext = AppData.ADMINDEVICESTATUS;
|
|
lblPrinterStatus.DataContext = AppData.ADMINDEVICESTATUS;
|
|
lblSensorStatus.DataContext = AppData.ADMINDEVICESTATUS;
|
|
}
|
|
|
|
private void LogoutButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void UserManagementButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
this.MainContentControl.Content = userManage;
|
|
}
|
|
|
|
private void DashboardButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
this.MainContentControl.Content = loguc;
|
|
}
|
|
|
|
private void SettingsButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
this.MainContentControl.Content = settings;
|
|
}
|
|
|
|
private void ReportsButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void ConfigurationButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
this.MainContentControl.Content = configuration;
|
|
}
|
|
|
|
private void btnShutdownApp_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (AppData.GetTransactionCode() != "")
|
|
{
|
|
MessageBox.Show("LƯU Ý, THAO TÁC NÀY SẼ LÀM MẤT TẤT CẢ DỮ LIỆU ĐANG THAO TÁC. " +
|
|
"HÃY HOÀN TẤT GIAO DỊCH ĐỂ TIẾP TỤC", "CẢNH BÁO", MessageBoxButton.OK);
|
|
}
|
|
else
|
|
{
|
|
System.Windows.Application.Current.Shutdown();
|
|
}
|
|
}
|
|
|
|
private void btnRestartApp_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (AppData.GetTransactionCode() != "")
|
|
{
|
|
MessageBox.Show("LƯU Ý, THAO TÁC NÀY SẼ LÀM MẤT TẤT CẢ DỮ LIỆU ĐANG THAO TÁC. " +
|
|
"HÃY HOÀN TẤT GIAO DỊCH ĐỂ TIẾP TỤC", "CẢNH BÁO", MessageBoxButton.OK);
|
|
}
|
|
else
|
|
{
|
|
string exePath = Process.GetCurrentProcess().MainModule.FileName;
|
|
|
|
Process.Start(exePath);
|
|
|
|
System.Windows.Application.Current.Shutdown();
|
|
}
|
|
}
|
|
}
|
|
}
|