Esempio n. 1
0
 public static int RoleEdit(AspNetUserRole entity)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Update(entity));
     }
 }
Esempio n. 2
0
 public static int Edit(Category entity)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         return(db.Update(entity));
     }
 }
Esempio n. 3
0
 // edit image
 public static void Edit(Image image)
 {
     using (var db = new ElectronicStoreConnectionDB())
     {
         db.Update(image);
     }
 }
Esempio n. 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));
     }
 }
Esempio n. 5
0
 // 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);
     }
 }
Esempio n. 6
0
 // 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));
     }
 }