public static int RoleEdit(AspNetUserRole entity) { using (var db = new ElectronicStoreConnectionDB()) { return(db.Update(entity)); } }
public static int Edit(Category entity) { using (var db = new ElectronicStoreConnectionDB()) { return(db.Update(entity)); } }
// edit image public static void Edit(Image image) { using (var db = new ElectronicStoreConnectionDB()) { db.Update(image); } }
public static int Delete(int id) { using (var db = new ElectronicStoreConnectionDB()) { var cate = Details(id); cate.Status = !cate.Status; return(db.Update(cate)); } }
// 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); } }
// 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)); } }