public void FromDto(CategoryProductAssociationDTO dto)
        {
            if (dto == null) return;

            this.Id = dto.Id;
            this.CategoryId = dto.CategoryId;
            this.ProductId = dto.ProductId;
            this.SortOrder = dto.SortOrder;
            this.StoreId = dto.StoreId;
        }
        //DTO
        public CategoryProductAssociationDTO ToDto()
        {
            CategoryProductAssociationDTO dto = new CategoryProductAssociationDTO();

            dto.Id = this.Id;
            dto.CategoryId = this.CategoryId;
            dto.ProductId = this.ProductId;
            dto.SortOrder = this.SortOrder;
            dto.StoreId = this.StoreId;
            
            return dto;
        }
Example #3
0
 public ApiResponse<CategoryProductAssociationDTO> CategoryProductAssociationsUpdate(CategoryProductAssociationDTO item)
 {
     ApiResponse<CategoryProductAssociationDTO> result = new ApiResponse<CategoryProductAssociationDTO>();
     result = RestHelper.PostRequest<ApiResponse<CategoryProductAssociationDTO>>(this.fullApiUri + "categoryproductassociations/" + item.Id + "?key=" + Enc(key), MerchantTribe.Web.Json.ObjectToJson(item));
     return result;
 }
Example #4
0
        public ApiResponse<bool> CategoryProductAssociationsQuickCreate(string productBvin, string categoryBvin)
        {
            ApiResponse<bool> response = new ApiResponse<bool>();

            CategoryProductAssociationDTO a = new CategoryProductAssociationDTO();
            a.CategoryId = categoryBvin;
            a.ProductId = productBvin;

            ApiResponse<CategoryProductAssociationDTO> result = CategoryProductAssociationsCreate(a);
            if (result.Content != null)
            {
                if (result.Content.Id > 0)
                {
                    response.Content = true;
                }
            }
            response.Errors = result.Errors;
            return response;
        }