public void CreateUser(UserEntity user, ProfileEntity profile)
 {
     DalUser du = user.ToDalUser();
     du.Profile = profile.ToDalProfile();
     DalProfile dp = profile.ToDalProfile();
     dp.User = user.ToDalUser();
     uow.Users.Create(du);
     //uow.Profiles.Create(dp);
     uow.Commit();
 }
 /// <summary>
 /// Create new user and save it to database.
 /// </summary>
 /// <param name="user"></param>
 public void CreateUser(UserEntity user)
 {
     if (user == null)
         throw new ArgumentNullException(nameof(user));
     userRepository.Create(user.ToDalUser());
     uow.Commit();
 }
Beispiel #3
0
 public UserEntity CreateUser(UserEntity user)
 {
     user.Roles.Add(userRepository.GetRole("User").ToBllRole());
     var temp = userRepository.Create(user.ToDalUser());
     if (temp != null)
         uow.Commit();
     return temp?.ToBllUser();
 }
 public void UpdateUser(UserEntity user)
 {
    var blluser= userRepository.GetById(user.Id).ToBllUser();
     if (blluser==null) throw new ArgumentNullException();
     user.Password = blluser.Password;
     user.CreationDate =blluser.CreationDate;
     userRepository.Update(user.ToDalUser());
     uow.Commit();
 }
 public void UpdateUser(UserEntity user)
 {
     try
     {
         _userRepository.Update(user.ToDalUser());
         _unitOfWorkuow.Commit();
     }
     catch (Exception e)
     {
         Log.LogError(e);
     }
 }
Beispiel #6
0
 public void CreateUser(UserEntity user)
 {
     userRepository.Create(user.ToDalUser());
     uow.Commit();
 }
        public IEnumerable<ProjectEntity> GetAllProjectsByUser(UserEntity user)
        {

            return repository.GetAllProjectsByUser(user.ToDalUser()).Select(p=>p.ToBllProject());
        }
 public void DeleteUserFromProject(UserEntity user, int projectId)
  {
      repository.DeleteUserFromProject(user.ToDalUser(), projectId);
      uow.Commit();
  }
 public void AddUserToProject(UserEntity user, int projectId)
  {
      repository.AddUserToProject(user.ToDalUser(), projectId);
      uow.Commit();
  }
 public void CloseAllActiveLotsCreatedByUser(UserEntity user)
 {
     _lotRepository.CloseAllLotsCreatedByUser(user.ToDalUser());
     _uow.Commit();
 }
 public int DownVoteContent(ContentEntity content, UserEntity user)
 {
     var temp = contentRepository.DownVote(content.ToDalContent(), user.ToDalUser());
     uow.Commit();
     return temp;
 }
 public void DeleteUser(UserEntity user)
 {
     uow.Users.Delete(user.ToDalUser());
     uow.Commit();
 }
 public void AddUser(UserEntity user)
 {
     userRepository.Create(user.ToDalUser());
     unitOfWork.Commit();
 }
 public void Delete(UserEntity user)
 {
     userRepository.Delete(user.ToDalUser());
     uow.Commit();
 }
 public void CreateUser(UserEntity user)
 {
     user.UserPassword = EncodePassword(user.UserPassword);
     _userRepository.Create(user.ToDalUser());
     _uow.Commit();
 }
 public void UpdateUser(UserEntity user)
 {
     _userRepository.Update(user.ToDalUser());
     _uow.Commit();
 }
Beispiel #17
0
 public void Create(UserEntity user)
 {
     uRepo.Create(user.ToDalUser());
     uow.Commit();
 }
 public void Update(UserEntity entity)
 {
     userRepository.Update(entity.ToDalUser());
     unitOfWork.Commit();
 }
 public int Create(UserEntity entity)
 {
     int id = userRepository.Add(entity.ToDalUser());
     unitOfWork.Commit();
     return id;
 }
 public void DeleteUser(UserEntity user)
 {
     userRepository.Delete(user.ToDalUser());
     unitOfWork.Commit();
 }
 public void Edit(UserEntity user)
 {
     userRepository.Update(user.ToDalUser());
     uow.Commit();
 }