Example #1
0
 public int InsertProduct(Product p)
 {
     try
     {
         db.Products.InsertOnSubmit(p);
         db.SubmitChanges();
     }
     catch
     {
         return -1;
     }
     return 1;
 }
Example #2
0
 public int UpdateProduct(Product p)
 {
     try
     {
         Product pp = db.Products.Single(n => n.id == p.id);
         pp.tensp = p.tensp;
         pp.dongia = p.dongia;
         pp.taydai = p.taydai;
         pp.idbrand = p.idbrand;
         pp.idloai = p.idloai;
         pp.idchatlieu = p.idchatlieu;
         pp.image1 = p.image1;
         pp.image2 = p.image2;
         pp.image3 = p.image3;
         pp.trangthai = p.trangthai;
         db.SubmitChanges();
     }
     catch
     {
         return -1;
     }
     return 1;
 }
Example #3
0
 partial void DeleteProduct(Product instance);
Example #4
0
 partial void UpdateProduct(Product instance);
Example #5
0
 partial void InsertProduct(Product instance);
Example #6
0
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.Type = null;
		}
Example #7
0
		private void attach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.Type = this;
		}