Esempio n. 1
0
 private void ProductsGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     currentProduct = (Product) e.AddedItems[0];
     TitleTextBox.DataContext = currentProduct.ProductDescriptors[0];
     TitleTextBox.SetBinding(TextBox.TextProperty, "Title");
     BodyTextBox.DataContext = currentProduct.ProductDescriptors[0];
     BodyTextBox.SetBinding(TextBox.TextProperty, "Body");
     relateds = WrapRelateds(currentProduct, from p in catalog.Products select p);
     RelatedGrid.ItemsSource = relateds;
 }
Esempio n. 2
0
 public ProductRelationship(Product product)
 {
     Product = product;
 }
Esempio n. 3
0
 private IList<ProductRelationship> WrapRelateds(Product product, IEnumerable<Product> products)
 {
     List<ProductRelationship> relationships = new List<ProductRelationship>();
     foreach (Product p in products)
     {
         ProductRelationship relationship = new ProductRelationship(p);
         relationship.IsRelated = product.Products_Relateds1.
                 Where<Products_Related>(r => r.RelatedSKU == p.SKU).Count() > 0;
         relationships.Add(relationship);
     }
     return relationships;
 }
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.DeliveryMethod = null;
		}
 partial void DeleteProduct(Product instance);
 partial void UpdateProduct(Product instance);
 partial void InsertProduct(Product instance);
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.InventoryStatus = null;
		}