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