예제 #1
0
 // 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);
     }
 }
예제 #2
0
 // 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);
     }
 }
예제 #3
0
 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);
     }
 }