Пример #1
0
 public int InsertProduct(Product p)
 {
     try
     {
         db.Products.InsertOnSubmit(p);
         db.SubmitChanges();
     }
     catch
     {
         return -1;
     }
     return 1;
 }
Пример #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;
 }
Пример #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)
		{
			this.SendPropertyChanging();
			entity.Type = null;
		}
Пример #7
0
		private void attach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.Type = this;
		}