private void SaveItem() { _item.SeasonID = SelectedSeason.SeasonCode; _item.ColorID = SelectedColor1.ColorCode; _item.Color2ID = SelectedColor2.ColorCode; _item.Color3ID = SelectedColor3.ColorCode; _item.SizeType = SelectedSizeTypeID.SizeTypeName; _item.Name = ItemName; // _item.Size = SelectedSize.SizeVal; _item.StyleTypeID = _selectedStyleType.ID; _item.DesignID = SelectedDesign.ID; // _item.Price = _validatedPrice; var deleteSizesPrices = from isz in context.ItemSizes where isz.Sku == this.SKU select isz; foreach (var isz in deleteSizesPrices) { context.ItemSizes.DeleteOnSubmit(isz); } foreach (var spc in SizePrices) { ItemSize isv = new ItemSize(); isv.Sku = this.SKU; isv.SizeVal = spc.Size; isv.Price = spc.Price; context.ItemSizes.InsertOnSubmit(isv); } if (!_itemExists) context.Items.InsertOnSubmit(_item); context.SubmitChanges(); this.RaiseAndSetIfChanged(vm => vm.SKU, ref _sku, ""); }
partial void UpdateItemSize(ItemSize instance);
partial void DeleteItemSize(ItemSize instance);
partial void InsertItemSize(ItemSize instance);