|
@@ -9,6 +9,7 @@ using System.Globalization;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using System.Windows;
|
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
|
|
|
|
|
namespace BlankApp1.ViewModels
|
|
@@ -26,9 +27,18 @@ namespace BlankApp1.ViewModels
|
|
|
{
|
|
|
_regionManager = regionManager;
|
|
|
// 需要获取菜单数据
|
|
|
- origMenus = menuService.QueryList(); ;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ origMenus = menuService.QueryList();
|
|
|
+
|
|
|
+ this.FillMenus(Menus, 0);
|
|
|
+ }
|
|
|
+ catch(Exception ex)
|
|
|
+ {
|
|
|
+ MessageBoxResult boxResult = MessageBox.Show("初始化失败,请检查与数据库的链接!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- this.FillMenus(Menus, 0);
|
|
|
}
|
|
|
|
|
|
public string EscapeUnicode( string str) // 将字符串编码为unicode转义序列(\uxxxx)
|