/// <summary> /// 依据sql语句查询用户 /// </summary> /// <param name="safeSql"></param> /// <returns></returns> private static IList <User> GetUsersBySql(string safeSql) { List <User> list = new List <User>(); using (DataTable table = DBHelper.GetDataSet(safeSql)) { foreach (DataRow row in table.Rows) { User user = new User(); user.Id = (int)row["Id"]; user.LoginName = (string)row["LoginId"]; user.LoginPwd = (string)row["LoginPwd"]; user.Name = (string)row["Name"]; user.Address = (string)row["Address"]; user.Phone = (string)row["Phone"]; user.Mail = (string)row["Mail"]; user.UserState = UserStateService.GetUserStateById((int)row["UserStateId"]); //FK user.UserRole = UserRoleService.GetUserRoleById((int)row["UserRoleId"]); //FK list.Add(user); } return(list); } }
public TeamTimeWarp_VsPackagePackage() { _restServiceUriFactory = new RestServiceUriFactory(); _tokenStore = new TokenStore(); _tokenPersister = new TokenPersister(); _authenticationService = new AuthenticationService(_tokenStore, _restServiceUriFactory, _tokenPersister, new SynchronizationContext()); _userStateService = new UserStateService(_tokenStore, _restServiceUriFactory, new AgentTypeProvider(TimeWarpAgent.VisualStudio)); }
public ServiceContainer(SynchronizationContext synchronizationContext) { var tokenStore = new TokenStore(); var uri = new RestServiceUriFactory(); var loginPersiter = new TokenPersister(); AuthenticationService = new AuthenticationService(tokenStore, uri, loginPersiter, synchronizationContext); RoomService = new RoomService(tokenStore, uri); GlobalRoomService = new GlobalRoomsService(tokenStore, uri, synchronizationContext); UserStateService = new UserStateService(tokenStore, uri, new AgentTypeProvider(TimeWarpAgent.WindowsTrayClient)); UserMessageService = new UserMessageService(tokenStore, uri, synchronizationContext); }
public static UserState GetUserStateById(int id) { return(UserStateService.GetUserStateById(id)); }
public static IList <UserState> GetAllUserStates() { return(UserStateService.GetAllUserStates()); }
public static void ModifyUserState(UserState userState) { UserStateService.ModifyUserState(userState); }
public static void DeleteUserStateById(int id) { UserStateService.DeleteUserStateById(id); }
public static void DeleteUserState(UserState userState) { UserStateService.DeleteUserState(userState); }
public static UserState AddUserState(UserState userState) { return(UserStateService.AddUserState(userState)); }