123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Aitex.Core.Account;
- using Aitex.Core.Util;
- using Aitex.Core.WCF;
- namespace Aitex.Triton160.UI.Wcf
- {
- public class AccountServiceClient : ServiceClientWrapper<IAccountService>, IAccountService
- {
- public AccountServiceClient()
- : base("Client_IAccountService", "AccountService")
- {
- }
- /// <summary>
- /// user login verify
- /// </summary>
- /// <param name="accountId"></param>
- /// <param name="accountPwd"></param>
- /// <returns></returns>
- public LoginResult Login(string accountId, string accountPwd)
- {
- LoginResult result = null;
- Invoke(svc => { result = svc.Login(accountId, accountPwd); });
- return result;
- }
- /// <summary>
- /// user logout system
- /// </summary>
- /// <param name="accountId"></param>
- public void Logout(string accountId)
- {
- Invoke(svc => { svc.Logout(accountId); });
- }
- /// <summary>
- /// get user data by accountId
- /// </summary>
- /// <param name="accountId"></param>
- /// <returns></returns>
- public GetAccountInfoResult GetAccountInfo(string accountId)
- {
- GetAccountInfoResult result = null;
- Invoke(svc => { result = svc.GetAccountInfo(accountId); });
- return result;
- }
- /// <summary>
- /// change account password
- /// </summary>
- /// <param name="accountId"></param>
- /// <param name="newPassword"></param>
- public ChangePwdResult ChangePassword(string accountId, string newPassword)
- {
- ChangePwdResult result = null;
- Invoke(svc => { result = svc.ChangePassword(accountId, newPassword); });
- return result;
- }
- /// <summary>
- /// create account
- /// </summary>
- /// <param name="newAccount"></param>
- /// <returns></returns>
- public CreateAccountResult CreateAccount(Account newAccount)
- {
- CreateAccountResult result = null;
- Invoke(svc => { result = svc.CreateAccount(newAccount); });
- return result;
- }
- /// <summary>
- /// Administrator user calls this method to delete an account.
- /// </summary>
- /// <param name="account"></param>
- /// <returns></returns>
- public DeleteAccountResult DeleteAccount(string accountId)
- {
- DeleteAccountResult result = null;
- Invoke(svc => { result = svc.DeleteAccount(accountId); });
- return result;
- }
- /// <summary>
- /// Update account information
- /// </summary>
- /// <param name="accountList"></param>
- /// <returns></returns>
- public UpdateAccountResult UpdateAccount(Account account)
- {
- UpdateAccountResult result = null;
- Invoke(svc => { result = svc.UpdateAccount(account); });
- return result;
- }
- /// <summary>
- /// get account list
- /// </summary>
- /// <returns></returns>
- public GetAccountListResult GetAccountList()
- {
- GetAccountListResult result = null;
- Invoke(svc => { result = svc.GetAccountList(); });
- return result;
- }
- /// <summary>
- /// 获取当前所有已登录的用户列表
- /// </summary>
- /// <returns></returns>
- public List<Account> GetLoginUsers()
- {
- List<Account> result = null;
- Invoke(svc => { result = svc.GetLoginUsers(); });
- return result;
- }
- /// <summary>
- /// 强制注销用户登录
- /// </summary>
- /// <param name="accountId"></param>
- /// <param name="kickoutReason"></param>
- public void KickUserOut(string accountId, string kickoutReason)
- {
- Invoke(svc => { svc.KickUserOut(accountId, kickoutReason); });
- }
- /// <summary>
- /// get all roles' perrmission
- /// </summary>
- /// <returns></returns>
- public SerializableDictionary<string, SerializableDictionary<string, ViewPermission>> GetAllRolesPermission()
- {
- SerializableDictionary<string, SerializableDictionary<string, ViewPermission>> result = null;
- Invoke(svc => { result = svc.GetAllRolesPermission(); });
- return result;
- }
- /// <summary>
- /// save all roles' permission
- /// </summary>
- /// <param name="data"></param>
- /// <returns></returns>
- public bool SaveAllRolesPermission(Dictionary<string, Dictionary<string, ViewPermission>> data)
- {
- bool result = false;
- Invoke(svc => { result = svc.SaveAllRolesPermission(data); });
- return result;
- }
- /// <summary>
- /// get all view's list
- /// </summary>
- /// <returns></returns>
- public SerializableDictionary<string, string> GetAllViewList()
- {
- SerializableDictionary<string, string> result = null;
- Invoke(svc => { result = svc.GetAllViewList(); });
- return result;
- }
- /// <summary>
- /// Get all defined roles
- /// </summary>
- /// <returns></returns>
- public IEnumerable<string> GetAllRoles()
- {
- IEnumerable<string> result = null;
- Invoke(svc => { result = svc.GetAllRoles(); });
- return result;
- }
- /// <summary>
- /// 检查账号是否仍旧有效
- /// </summary>
- /// <param name="accountId"></param>
- public void CheckAlive(string accountId)
- {
- Invoke(svc => { svc.CheckAlive(accountId); });
- }
- /// <summary>
- /// 获取流程视图的许可
- /// </summary>
- /// <returns></returns>
- public string GetProcessViewPermission()
- {
- string result = null;
- Invoke(svc => { result = svc.GetProcessViewPermission(); });
- return result;
- }
- /// <summary>
- /// 保存流程视图的许可
- /// </summary>
- /// <param name="viewXML"></param>
- /// <returns></returns>
- public bool SaveProcessViewPermission(string viewXML)
- {
- bool result = false;
- Invoke(svc => { result = svc.SaveProcessViewPermission(viewXML); });
- return result;
- }
- }
- }
|