/// <summary> /// Imports the users. /// </summary> /// <returns>Number of created users</returns> public int ImportUsers() { var radiusUsers = _radiusUserRepository.GetUsers(); int created = 0; foreach (var radiusUser in radiusUsers) { if (_userRepository.GetUserByRadiusId(radiusUser.Id) == null && _userRepository.FindByUserName(radiusUser.Username) == null) { var user = new CcmUser { Id = Guid.NewGuid().ToString(), UserName = radiusUser.Username, RadiusId = radiusUser.Id, UserType = UserType.SIP }; _userRepository.Create(user); created++; } } return(created); }
public ActionResult GetRadiusUsers() { List <RadiusUser> users = _radiusUserRepository.GetUsers(); return(View(users)); }