コード例 #1
0
ファイル: UserBus.cs プロジェクト: 1461634/DoAnWeb2
 public static int RoleEdit(AspNetUserRole entity)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Update(entity));
     }
 }
コード例 #2
0
 public static int Edit(Category entity)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Update(entity));
     }
 }
コード例 #3
0
ファイル: ImageBus.cs プロジェクト: 1461634/DoAnWeb2
 // edit image
 public static void Edit(Image image)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         db.Update(image);
     }
 }
コード例 #4
0
 public static int Delete(int id)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         var cate = Details(id);
         cate.Status = !cate.Status;
         return(db.Update(cate));
     }
 }
コード例 #5
0
ファイル: ProductBus.cs プロジェクト: 1461634/DoAnWeb2
 // get product details by id
 public static Product Details(int?id)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         var product = db.SingleOrDefault <Product>("SELECT * FROM Products WHERE Id = @0", id);
         product.Viewed += 1;
         db.Update(product);
         return(product);
     }
 }
コード例 #6
0
ファイル: ProductBus.cs プロジェクト: 1461634/DoAnWeb2
 // edit product
 public static int Edit(Product entity)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         Product p = ProductBus.Details(entity.Id);
         p.BrandId      = entity.BrandId;
         p.CateId       = entity.CateId;
         p.Description  = entity.Description;
         p.ImageUrl     = entity.ImageUrl;
         p.Name         = entity.Name;
         p.Price        = entity.Price;
         p.TypeId       = entity.TypeId;
         p.Quantity     = entity.Quantity;
         p.Warranty     = entity.Warranty;
         p.DateModified = entity.DateModified;
         return(db.Update(p));
     }
 }