// delete image public static bool ChangeStatus(int id) { using (var db = new ElectronicStoreConnectionDB()) { var image = db.SingleOrDefault <Image>("WHERE Id = @0", id); image.Status = !image.Status; db.Save(image); return(image.Status); } }
// change status of product public static bool ChangeStatus(int id) { using (var db = new ElectronicStoreConnectionDB()) { var product = db.SingleOrDefault <Product>("WHERE Id = @0", id); product.Status = !product.Status; product.DateModified = DateTime.Now; db.Save(product); return(product.Status); } }
public static int ChangeStatus(int id) { using (var db = new ElectronicStoreConnectionDB()) { var order = db.SingleOrDefault <Order>("WHERE Id = @0", id); if (order.Status == 0) { order.Status = 1; } else if (order.Status == 1) { order.Status = 2; } else { order.Status = 2; } db.Save(order); return(order.Status); } }