Ejemplo n.º 1
0
        /// <summary>
        /// 登陆系统
        /// </summary>
        private void Login()
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(UserName) && !string.IsNullOrWhiteSpace(Password))
                {
                    this.Report = "正在验证登录 . . .";
                    //查询出当前角色可以使用的所有功能
                    LoginResultData.TheMainConfig = DataRequest <UcGnglEntity> .Addition(new UcGnglEntity());

                    MainViewModel model = new MainViewModel();
                    model.InitDefaultView();
                    var dialog = ServiceProvider.Instance.Get <IModelDialog>("MainViewDlg");
                    dialog.BindViewModel(model);
                    Messenger.Default.Send(string.Empty, "ApplicationHiding");
                    dialog.ShowDialog();
                    ApplicationShutdown();
                }
                else
                {
                    MessageBox.Show("请输入关键字");
                }
            }
            catch (Exception)
            {
                this.Report = "系统出现故障,请联系管理员处理";
            }
        }