Example #1
0
        /// <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);
            }
        }
Example #2
0
        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);
        }
Example #4
0
 public static UserState GetUserStateById(int id)
 {
     return(UserStateService.GetUserStateById(id));
 }
Example #5
0
 public static IList <UserState> GetAllUserStates()
 {
     return(UserStateService.GetAllUserStates());
 }
Example #6
0
 public static void ModifyUserState(UserState userState)
 {
     UserStateService.ModifyUserState(userState);
 }
Example #7
0
 public static void DeleteUserStateById(int id)
 {
     UserStateService.DeleteUserStateById(id);
 }
Example #8
0
 public static void DeleteUserState(UserState userState)
 {
     UserStateService.DeleteUserState(userState);
 }
Example #9
0
 public static UserState AddUserState(UserState userState)
 {
     return(UserStateService.AddUserState(userState));
 }