Exemple #1
0
 public IEnumerable <UserDTO> GetContacts(UserDTO user)
 {
     return(_mapper.Map <IEnumerable <User>, IEnumerable <UserDTO> >(unit.UserRepository.GetById(user.Id)?.UserContact?.Contacts));
 }
Exemple #2
0
 public void AddUser(UserDTO u)
 {
     p.AddUser(mapper.Map <User>(u));
 }
Exemple #3
0
 public AvatarDTO GetAvatar(UserDTO user)
 {
     return(_mapper.Map <AvatarDTO>((unit.AvatarRepository.Get(u => u.IsActive && u.UserId == user.Id))?.FirstOrDefault()));
 }
Exemple #4
0
 public void AddUser(UserDTO newUser)
 {
     unit.UserRepository.Create(_mapper.Map <User>(newUser));
     unit.UserRepository.Save();
 }
Exemple #5
0
 public void AddUser(UserDTO user)
 {
     _unitOfWork.UserRepository.Insert(_mapper.Map <User>(user));
     _unitOfWork.Commit();
 }
Exemple #6
0
 public OrderDTO GetByNick(UserDTO user)
 {
     return(null);
 }
Exemple #7
0
        public bool IsUserReservBook(BookProductDTO bookProductDTO, UserDTO userDTO)
        {
            var prod = _unitOfWork.ProductRepository.GetByID(bookProductDTO.Id);

            return(_unitOfWork.ReservRepository.Get(r => r.ProductId == prod.BookId && r.UserId == userDTO.Id && r.IsActive).Count() != 0);
        }
Exemple #8
0
 public IEnumerable <SaleDTO> GetSales(UserDTO userDTO)
 {
     return(_mapper.Map <IEnumerable <Sale>, IEnumerable <SaleDTO> >(_unitOfWork.SaleRepository.Get(r => r.UserId == userDTO.Id)));
 }
Exemple #9
0
 public IEnumerable <ReservDTO> GetReservs(UserDTO userDTO)
 {
     return(_mapper.Map <IEnumerable <Reserv>, IEnumerable <ReservDTO> >(_unitOfWork.ReservRepository.Get(r => r.UserId == userDTO.Id)));
 }
Exemple #10
0
 public UserTypeDTO GetUserType(UserDTO userDTO)
 {
     return(_mapper.Map <UserTypeDTO>(_unitOfWork.UserTypeRepository.GetByID(userDTO.UserTypeId)));
 }
Exemple #11
0
 public void UpdateUser(UserDTO userDTO)
 {
     userDAL.UpdateUser(userDTO);
 }