public bool RemoveAssociatedProduct(string fileBvin, string productBvin) { ProductFileAssociation x = this.crosses.FindByFileIdAndProductId(fileBvin, productBvin); if (x == null) { return(false); } return(this.crosses.Delete(x.Id)); }
public ProductFile FindByBvinAndProductBvin(string bvin, string productBvin) { ProductFileAssociation x = this.crosses.FindByFileIdAndProductId(bvin, productBvin); if (x != null) { ProductFile f = Find(x.FileId); f.AvailableMinutes = x.AvailableMinutes; f.MaxDownloads = x.MaxDownloads; return(f); } return(null); }
public bool AddAssociatedProduct(string fileBvin, string productBvin, int availableMinutes, int maxDownloads) { long storeId = context.CurrentStore.Id; RemoveAssociatedProduct(fileBvin, productBvin); ProductFileAssociation x = new ProductFileAssociation(); x.AvailableMinutes = availableMinutes; x.FileId = fileBvin; x.MaxDownloads = maxDownloads; x.ProductId = productBvin; x.StoreId = storeId; return(this.crosses.Create(x)); }