示例#1
0
 private void LoadUser_Completed(LoadUserOperation operation)
 {
     if (!operation.User.Identity.IsAuthenticated)
     {
         this.RootVisual = new Logon();
     }
     else
     {
         DocumentManager.Web.User lUser = operation.User.Identity as DocumentManager.Web.User;
         MainPageViewModel.User = lUser;
         this.RootVisual        = new MainPage();
     }
 }
示例#2
0
        private void LoginOperation_Completed(LoginOperation loginOperation)
        {
            IsBusy = false;
            App app = Application.Current as App;


            if (loginOperation.LoginSuccess)
            {
                DocumentManager.Web.User lUser = loginOperation.User.Identity as DocumentManager.Web.User;

                if (lUser.ExpireDay == -1100)
                {
                    NotifyWindow notifyWindow = new NotifyWindow("注册错误", "注册信息丢失, 请与 管理员 联系");
                    notifyWindow.Show();
                    return;
                }
                else if (lUser.ExpireDay < 0)
                {
                    NotifyWindow notifyWindow = new NotifyWindow("应用程序已经过期", "应用程序已经过期" + lUser.ExpireDay.ToString() + "天, 请与 管理员 联系");
                    notifyWindow.Show();
                    return;
                }
                else if (lUser.ExpireDay < 30)
                {
                    NotifyWindow notifyWindow = new NotifyWindow("过期", "还有" + lUser.ExpireDay + "天, 应用程序即将过期,请与 管理员 联系");
                    notifyWindow.Show();
                }

                app.MainPageViewModel.User = lUser;
                app.SuccessLogon();
            }
            else
            {
                NotifyWindow notifyWindow = new NotifyWindow("用户名或密码错误", "用户名或密码错误");
                notifyWindow.Show();
                return;
            }
        }