示例#1
0
        public FavoriteEntity Create(FavoriteEntity entity)
        {
            var r = this._favoriteRepository.Insert(entity);
            if (r != null)
            {
                //TODO:对用户账户操作
                this._userService.AddFover(entity.User_Id, 1, entity.CreatedUser);
            }

            return r;
        }
示例#2
0
        public void Del(FavoriteEntity entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            entity.Status = (int)DataStatus.Deleted;
            this._favoriteRepository.Delete(entity);

            //TODO: 账户减少一个fover
            this._userService.SubFover(entity.User_Id, 1, entity.User_Id);
        }
示例#3
0
        public FavoriteInfoResponse FavoriteInfoResponseMapping(FavoriteEntity source, ProductEntity entity)
        {
            var target = Mapper.Map<FavoriteEntity, FavoriteInfoResponse>(source);
            target.FavoriteSourceName = entity == null ? String.Empty : entity.Name;

            return target;
        }