public void Login() { if (validate()) { AccountService.AccountServiceClient proxy = new AccountService.AccountServiceClient(); try { Session = proxy.StartSession(account); } catch (FaultException <HCSMSException> ex) { raiseError(ex); } catch (Exception ex) { raiseError(ex); throw ex; } } else { ProcessNotifyEvent(ValidateFail, new NotifyEventArgs("用户名或密码无效!")); } }
public bool IsLogin() { using (AccountService.AccountServiceClient proxy = new AccountService.AccountServiceClient()) { try { return(proxy.IsLogin(Session)); } catch (FaultException <HCSMSException> ex) { raiseError(ex); return(false); } catch (Exception ex) { raiseError(ex); throw ex; } } }
//check for user authentication private bool IsAuthorize(Session session) { using (AccountService.AccountServiceClient proxy = new AccountService.AccountServiceClient()) { try { return(proxy.IsLogin(session)); } catch (FaultException <HCSMSException> ex) { raiseError(ex); return(false); } catch (Exception ex) { raiseError(ex); return(false); } } }