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 { /// /// Interaction logic for AdminWindow.xaml /// 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) { lblStatus.DataContext = AppData.CDMSTATE; } 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(); } } } }