public async Task <Price> CreatePrice(Guid priceListIdentifier, Guid productIdentifier, List <VolumePrice> volumePrices, string actual = "200", string addToCart = "0", bool isDiscountable = false, bool isEnabled = true, string list = "155.77", string sale = "0", string signIn = "0", string webOnly = "0") { PriceContent content = new PriceContent(); content.Actual = actual; content.AddToCart = addToCart; content.IsDiscountable = isDiscountable; content.IsEnabled = isEnabled; content.List = list; content.PriceListIdentifier = priceListIdentifier; content.ProductListIdentifier = productIdentifier; content.Sale = sale; content.SignIn = signIn; content.VolumePrices = volumePrices; content.WebOnly = webOnly; Price newEntity = new Price { Contents = content }; var entity = await _context.Prices.AddAsync(newEntity); return(entity); }
/// <summary> /// get a shop price /// written by jjh /// </summary> /// <returns></returns> public int GetShopPrice() { if (string.IsNullOrWhiteSpace(PriceContent)) { return(0); } else { string[] prices_list = PriceContent.Split(','); if (prices_list == null || prices_list.Length == 0) { return(0); } else { int temp = 0; int.TryParse(prices_list[0], out temp); return(temp); } } }