public static bool Add(int productId, string tableName, IList <ProductDataInfo> productDataInfoList) { bool flag = true; foreach (ProductDataInfo info in productDataInfoList) { flag = Add(productId, tableName, info); if (!flag) { dal.DeleteByProduct(productId, tableName); return(flag); } } return(flag); }