private bool checkPermission() { if (!logined) { Codes.RollCallDataContext dc = Codes.DataOperation.getDataContext(); if (dc.Settings.Where(t => t.Tag == "RollCall").Count() == 0) { // 进行必要的应用程序设置 MessageBox.Show("信息尚未初始化,接下来请完应用程序配置任务!", "点名系统", MessageBoxButton.OK, MessageBoxImage.Information); Windows.SettingsWindow sw = new Windows.SettingsWindow(); sw.ShowDialog(); return(false); } else { // ?? 为结合运算符,当可空类型为空时,logined=false logined = new LoginWindow().ShowDialog() ?? false; } } return(logined); }
private static void OpenSettingsWindow() { var settingsWindow = new Windows.SettingsWindow(); settingsWindow.ShowDialog(); }