示例#1
0
        //
        // Products/Create
        public ActionResult Create()
        {
            var product = new Product();
            UpdateModel( product, Request.Form.AllKeys );

            northwind.AddProduct( product );
            northwind.SubmitChanges();

            return RedirectToAction( "Category", new { ID = product.CategoryID } );
        }
示例#2
0
 // Add a New Product
 public void AddProduct( Product product )
 {
     Products.InsertOnSubmit( product );
 }
示例#3
0
 partial void DeleteProduct( Product instance );
示例#4
0
 partial void UpdateProduct( Product instance );
示例#5
0
 partial void InsertProduct( Product instance );
示例#6
0
 private void detach_Products( Product entity )
 {
     SendPropertyChanging();
     entity.Category = null;
 }
示例#7
0
 private void attach_Products( Product entity )
 {
     SendPropertyChanging();
     entity.Category = this;
 }
示例#8
0
 private void detach_Products( Product entity )
 {
     SendPropertyChanging();
     entity.Supplier = null;
 }
示例#9
0
 private void attach_Products( Product entity )
 {
     SendPropertyChanging();
     entity.Supplier = this;
 }