Ejemplo n.º 1
0
 void Client_LogoutCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <bool> e)
 {
     try
     {
         if (e.Error != null)
         {
             MyMessageBox.ShowInfo("退出失败. " + e.Error);
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show("退出异常。" + exc.Message);
     }
 }
Ejemplo n.º 2
0
        void Client_LoginCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <OperResultObject> e)
        {
            if (e.Cancelled)
            {
                App.BusyToken.CloseBusyWindow();
                return;
            }

            if (e.Error != null || e.Result == null)
            {
                App.BusyToken.CloseBusyWindow();
                LogHelper.Instance.AddErrorLog("服务器连接失败。", e.Error);
                MyMessageBox.ShowInfo("服务器连接失败。");
                return;
            }

            if (e.Result.OperResultCode == OperResult.RESULTCODE_TRUE)
            {
                this._syn.Post(o =>
                {
                    this.txtUserName.Text     = "";
                    this.txtPassword.Password = "";
                }, null);

                GlobalData.InitToken(e.Result.Message);
                App.MessageVMObject.AsyncGetSystemConfig();
            }
            else
            {
                App.BusyToken.CloseBusyWindow();
                if (string.IsNullOrEmpty(e.Result.Message))
                {
                    MyMessageBox.ShowInfo(OperResult.GetMsg(e.Result.OperResultCode));
                }
                else
                {
                    MyMessageBox.ShowInfo(e.Result.Message);
                }
            }

            //if (e.Result == "ISLOGGED")
            //{
            //    App.BusyToken.CloseBusyWindow();
            //    MyMessageBox.ShowInfo("您的账户正在其它客户端登录,我们已将对方退出,请重新登录。");
            //    return;
            //}
        }