public Stream FindByUserId(string userId) { IFindUserInfoBusinessService businessService = (IFindUserInfoBusinessService)BusinessFactory.Create(Keywords.FindUserInfo); OperationResult result = businessService.FindByUserId(Convert.ToInt64(userId)); return(result.ToJsonStream()); }
public Stream Info(string username) { IFindUserLoginBusinessService businessService = (IFindUserLoginBusinessService)BusinessFactory.Create("Find.Common.Resources.UserLogin"); OperationResult result = businessService.FindByUsername(username); List <UserLogin> logins = (List <UserLogin>)result.Data; if (logins.Count > 0) { Int64 userID = logins[0].IdUser; IFindUserInfoBusinessService bs = (IFindUserInfoBusinessService)BusinessFactory.Create("Find.Common.Resources.UserInfo"); result = bs.FindByUserId(userID); List <UserInfo> userInfoes = (List <UserInfo>)result.Data; if (userInfoes.Count > 0) { UserInfo info = userInfoes[0]; info.Username = username; } } return(result.ToJsonStream()); }