/// <summary>
 /// Removes a product from the database.
 /// </summary>
 /// <param name="product">The Id property selects the product.</param>
 /// <returns></returns>
 public static bool Remove(ProductListEntity product)
 {
     if ((product == null)
         || (TransactionProvider.IsExistBody(p => p.ProductId == product.Id)))
         return false;
     return DatabaseConnection.Remove<ProductEntity>(p => p.Id == product.Id);
 }
Esempio n. 2
0
 /// <summary>
 /// Removes a partner from the database with the same Id.
 /// </summary>
 /// <param name="partner">The Id property selects the partner.</param>
 /// <returns></returns>
 public static bool Remove(PartnerEntity partner)
 {
     if ((partner == null) ||
         (TransactionProvider.IsExistHead(p => p.PartnerId == partner.Id)))
     {
         return(false);
     }
     return(DatabaseConnection.Remove <PartnerEntity>(p => p.Id == partner.Id));
 }